Few days back I have installed ecryptfs, created a private directory using it. Now my Ubuntu login became super slow. I have tried removing ecryptfs from Synaptic. I found It, it can not be deleted that way. Somewhere I have read about this command
ecryptfs-setup-private --undo
But this command displays a rather confusing list of commands on terminal. I don't want to mess up my installation, neither want to loose my administrator account.
Now my question is, how can I safely remove /home/user/Private (.Private) and remove ecryptfs encryption ?
The removal procedure is documented in the ecryptfs-setup-private(1) utility, with the
--undo
option:Full disclosure: I am one of the authors and maintainers of eCryptfs.
Actually ecryptfs tells you very specifically what to do when you run
ecryptfs-setup-private --undo
, just follow its instructions.This command populates the
$PRIVATE
variable with the path to your private directory. Either the path is stored in~/.ecryptfs/Private.mnt
file (where ~ is your home directory) or if the file doesn't exist, it will fall back to ~/Private path. You can then runecho $PRIVATE
command to verify content of the PRIVATE variable. When you see $PRIVATE in the following commands, it will be substituted with the contents of the variable, ~/Private in your case.This is important.
eCryptFS is kind of a filesystem which is mounted in user space (Wikipedia explains what's mounting about. That's also the reason why the Private folder cannot be removed so easily. Think of it as kind of proxy which transparently encrypts and decrypts your files. This command un-mounts the folder which effectively disables the encryption.
chmod
sets file permissions. In this case, you say: "make file/directory stored in $PRIVATE readable, writable and executable for me (700)" – you can't otherwise delete the directory since you don't have write access.This does exactly what it says.
rm
command means ReMove,-r
means recursive (to recursively remove directories), andf
means Force ("stop nagging me, just delete it"). This will remove all these three directories: $PRIVATE, ~/.Private, ~/.ecryptfsIf you want to, you can remove these directories manually from Nautilus (just check "View > Show hidden files" to see .Private and .ecryptfs directories in your home dir).
This will remove
ecryptfs-utils
andlibecryptfs0
. You can do this from Synaptic instead or just ignore it if you want to keep eCryptFS around (e.g. for other users).If you follow these instructions, there's no risk of wrecking your system or losing your files – unless, of course, you don't backup your files from ~/Private directory.
I followed the instructions given in https://help.ubuntu.com/community/EncryptedPrivateDirectory#Using%20in%20conjunction%20with%20Auto-login in the section "How to Remove an Encrypted Private Directory Setup".
Notes:
If you don`t have access to the data in your Private folder, or the file names are encrypted, then follow this steps:
Note: This procedure is an alternative I found by myself (with a friend help) because all I read in forums doesn`t work for me.
The last command will open the folder /tmp/ecryptfs.yyyyyyyy were you can acess your decrypted data in order to make the backup. Then you close the folder and close the terminal.