[[advanced:target]]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
advanced:target [2018/10/04 23:48] – [Enable encryption, and create an encrypted dataset] danadvanced:target [2018/10/06 12:20] dan
Line 6: Line 6:
  
 Unfortunately, the Ubuntu 18.04 image uses a 32-bit kernel, and the available ZFS packages aren't compatible with a 32-bit kernel.  This means I'll need to compile the ZFS pieces myself, and they're not known to be stable with a 32-bit kernel in any event.  Updates to come. Unfortunately, the Ubuntu 18.04 image uses a 32-bit kernel, and the available ZFS packages aren't compatible with a 32-bit kernel.  This means I'll need to compile the ZFS pieces myself, and they're not known to be stable with a 32-bit kernel in any event.  Updates to come.
 +===== Create a non-privileged user with sudo capability ===== 
 +<code> 
 +adduser fred 
 +usermod -aG sudo fred 
 +</code>
 ===== Rebuild the kernel ===== ===== Rebuild the kernel =====
-To ensure you have the headers for the running kernel installed, run the following commands (taken from the [[https://wiki.odroid.com/odroid-xu4/software/building_kernel#y|Hardkernel wiki]]):+In order to build ZFS, you must have the headers for the running kernel installed on the system.  Since there does not appear to be a linux-headers package available matching the kernel version installed on the Odroid, this means you'll need to rebuild the kernel.  To do this, run the following commands (taken from the [[https://wiki.odroid.com/odroid-xu4/software/building_kernel#y|Hardkernel wiki]]):
 <code> <code>
-sudo apt update && sudo apt upgrade +sudo apt update && sudo apt upgrade && apt dist-upgrade && apt autoremove 
-sudo apt install git gcc g++ build-essential+sudo apt install git gcc g++ build-essential bc libssl-dev
 git clone --depth 1 https://github.com/hardkernel/linux -b odroidxu4-4.14.y git clone --depth 1 https://github.com/hardkernel/linux -b odroidxu4-4.14.y
 cd linux cd linux
Line 32: Line 36:
 These instructions are taken from the [[https://github.com/zfsonlinux/zfs/wiki/Building-ZFS|ZFSonLinux Wiki]].  First, install the necessary dependencies: These instructions are taken from the [[https://github.com/zfsonlinux/zfs/wiki/Building-ZFS|ZFSonLinux Wiki]].  First, install the necessary dependencies:
 <code> <code>
-sudo apt install build-essential autoconf libtool gawk alien fakeroot zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev parted lsscsi ksh libssl-dev libelf-dev+sudo apt install autoconf libtool gawk alien fakeroot zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev parted lsscsi ksh libssl-dev libelf-dev
 </code> </code>
 Then download, build, and install the ZFS code: Then download, build, and install the ZFS code:
Line 56: Line 60:
  
 ===== Enable encryption, and create an encrypted dataset ===== ===== Enable encryption, and create an encrypted dataset =====
-**FreeNAS doesn't support OpenZFS encryption at this time, and it's not possible to replicate from a non-encrypted dataset to an encrypted one.  This documentation is left for the sake of completeness.** 
  
 The idea of this system is to be a standalone storage "brick", which could be left at a remote location where you might not fully trust the network operator.  ZFS on Linux supports dataset encryption for this purpose, and material for this section is drawn from this [[https://datacenteroverlords.com/2017/12/17/zfs-on-linux-with-encryption-part-2/|blog post]].  You'll first need to enable that feature on your pool: The idea of this system is to be a standalone storage "brick", which could be left at a remote location where you might not fully trust the network operator.  ZFS on Linux supports dataset encryption for this purpose, and material for this section is drawn from this [[https://datacenteroverlords.com/2017/12/17/zfs-on-linux-with-encryption-part-2/|blog post]].  You'll first need to enable that feature on your pool:
Line 69: Line 72:
  
 ===== Create a replication user ===== ===== Create a replication user =====
-For the sake of security, it would be best if replication to this device ran as a user other than root.  Start by creating the user:+For the sake of security, it would be best if replication to this device ran as a user other than root.  First, create a user in the FreeNAS web GUI called ''zfsuser'' Note the numeric userid for that user
 + 
 +Then, on the Odroid, as root, run
 <code> <code>
-adduser zfsuser +adduser zfsuser -u userid -s /bin/false
-</code> +
-Disable login for that user: +
-<code> +
-chsh -s /bin/false zfsuser +
-</code> +
-Generate a SSH keypair for that user: +
-<code> +
-sudo -u zfsuser ssh-keygen+
 </code> </code>
 +where "userid" is the numeric user ID noted on the FreeNAS box.
 +
 Now allow that user to make changes on the encrypted dataset: Now allow that user to make changes on the encrypted dataset:
 <code> <code>
 zfs allow -ldu zfsuser create,destroy,diff,mount,readonly,receive,release,send,userprop dozer/backup zfs allow -ldu zfsuser create,destroy,diff,mount,readonly,receive,release,send,userprop dozer/backup
 </code> </code>
 +===== Install Zerotier ===== 
 +[[https://zerotier.com/|Zerotier]] will create an encrypted virtual network connection between your Odroid and your FreeNAS box.  It's installed by default on FreeNAS, but you'll need to install it on the Odroid.  Run these commands: 
 +<code> 
 +sudo apt install curl 
 +curl https://install.zerotier.com | sudo bash 
 +</code>
  • advanced/target.txt
  • Last modified: 2018/10/10 00:02
  • by dan