How do I move my encrypted /home to a new computer?
Great question! I actually do this quite frequently (every few months). To do so, I use rsync to copy all of my /home
partition/directory from the OLD machine to the NEW one.
First, ensure that you have openssh-server
and ecryptfs-utils
installed and running on the NEW machine.
sudo apt-get install openssh-server ecryptfs-utils
You could install your public SSH key in the root user's /root/.ssh/authorized_keys
file. But I usually set a root password on the NEW machine.
sudo passwd
Also, on the NEW machine, create a new user, who's name and password precisely matches the name and password on the old machine.
sudo adduser YOURUSER
Make absolutley sure that YOURUSER is NOT currently logged into either the NEW machine or the OLD machine.
Now, from the OLD machine, as root, rsync your /home
directory from the OLD to the NEW machine:
sudo rsync -aP /home/ NEW:/home/
Finally, make absolutely sure that the files on the NEW machine are owned by YOURUSER:
sudo chown -R /home/.ecryptfs/YOURUSER /home/YOURUSER
And that should do it! You should be able to login as normal to your NEW machine and read and write your data!
Full disclosure: I'm the author and maintainer of Ubuntu's Encrypted Home Directory feature.