I have a new Ubuntu 10.04 installation with encrypted home directory (using the built-in encryption offered by Ubuntu installer).
What's the easiest way to stop using encryption? (I.e., to decrypt my home directory permanently.)
(It's giving me problems with kernel updates, and I'd just like to cut down on all the hassle I'm having with this installation.)
Googling around, I found this post:
Some notes
sudo
privileges would work equally well).ecryptfs-utils
andlibecryptfs0
would work, I needed to remove/home/.ecryptfs/<myusername>
. (It complained thatecryptfs-utils
was in use.)Other than that, this worked for me. It's far from simple though, so feel free to post better solutions!
Here you are, hope this helps (see
ecryptfs-setup-private(1)
):The output claims:
1st thing to do: BACKUP YOUR HOME. I can't say it louder... basically undoing encryption is equivalent to resetting (
rm -rf
) your home, which is in fact hidden by a mount.2nd step: log out of any desktop manager and go to a virtual console (Ctrl + Alt + F3)
Finally, for details:
In the event that you want to remove your eCryptfs Private Directory setup, you will need to very carefully perform the following actions manually:
Obtain your Private directory mountpoint
PRIVATE= cat ~/.ecryptfs/Private.mnt 2>/dev/null || echo $HOME/Private
Ensure that you have moved all relevant data out of your
$PRIVATE
directoryUnmount your encrypted private directory
Make your Private directory writable again
Remove
$PRIVATE
,~/.Private
,~/.ecryptfs
Note: This is very permanent, be very careful.Uninstall the utilities
I would say step 5 is a bit wrong : there's no need to delete
$PRIVATE
, which was for me my home....After
.Private
and.ecryptfs
deletion, just restore your home :]This steps will work in a server environment
Backup your home directory
Confirm whether everything is backup
Umount the home folder, because the encryption program usually mounts it to mount point e.g
/home/$USER
,also known as$HOME
. You can confirm your mount point by runningdf -h $HOME
. You will have tocd /tmp
(or some other non-$HOME
directory) to be able to unmount$HOME
.Delete the old home folder
Remove encrytion program file
Remove encryption utillities from the system
Restore unencrypted home folder back to it original path
Change ownership of the restored folder back to your user
Logout/Login, to be sure all user stuff gets restarted right (or that errors will occur while you remember what you're done).
Adding another guide to the long list after I realized that the most intrusive steps mentioned elsewhere are not necessary.
My guide needs no reboot and I have successfully finished it over SSH. It should also work if there are other eCryptfs mounts on the machine.
The only non-obvious requirement is to be able to login as another user with
sudo
access.Login as the user with the encrypted home directory (called
user
in this guide).Just to keep the paths in the following steps simple and symmetric:
Duplicate the decrypted home folder contents to another directory.
Logout (
exit
orlogout
). Login as another sudoer.Check that the eCryptfs mount is unmounted. Do not
umount
it manually, it may lead to data loss! (Experienced myself. I was having another SSH session withuser
logged in.)The output must be empty. Or, if there are any other eCryptfs mounts, it must not contain
/home/user
.Just like step 2.
Mark the duplicate as not being managed with eCryptfs. (There is no need to uninstall eCryptfs packages, especially when there are other eCryptfs mounts.)
Move the not encrypted home directory into place.
Login as
user
and check that everything works and eCryptfs does not kick in.Remove the original contents of
user
’s home folder and the encrypted data.Jonik’s explanation works well. But instead of step 2, I did:
rm -rf .ecryptfs
Then, instead of step 6: Press Ctrl+F7. If your GUI login screen does not appear, press Ctrl+F8.
if you can backup to an external storage, do it. (Not directly needed, but always good before file manipulation.)
get familiar with
tty
, at least a little. (PressCtrl Alt F7
,Ctrl Alt F1
etc.) You will need to work with twotty
-s. One root and one of your main user.log in as
root
on a separate tty, create a new home directorylog out of the graphical session. You can reboot to make sure no programs are working from under your normal user.
log in as your normal user on a separate tty, move all your files to the new destination:
using the
root
tty, rename the directories:everything should work by now.:) Once you're ready, remove the old files
/home/.encryptfs
,/home/user.encfs
,/home/user/.Private
,/home/user/.encryptfs
. If you want, you can rename them first and remove them later.I didn't use any of the answers here. Instead (in Ubuntu Studio 14.04):
I see no reason that removing the package which provides for encrypted home directories should not be optional, and I've deferred removing the new user account I created for this purpose since I think it might come in handy in future.
My reason for doing this? The old computer looks like it's failing. When it does fail, I want to be able to access the HD on another computer without any hassles.
In Ubuntu 16.04 these steps were performed:
1:
sudo cp -rp /home/USERNAME /home/USERNAME.backup
2:
sudo -i
3:
umount -fl /home/USERNAME
4:
rm -rf /home/USERNAME
5:
apt-get remove ecryptfs-utils libecryptfs0 -s
6:
mv /home/USERNAME.backup /home/USERNAME && rm -rf /home/USERNAME/.Private && rm -rf /home/USERNAME/.ecryptfs
7:
reboot now
Simple solution which worked for me:
You should have another user with sudo access
sudo rm -rf /home/youruser/.ecryptfs
sudo rm /home/youruser/.Private
sudo apt-get remove --purge ecryptfs-utils libecryptfs1
sudo reboot