Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
18
rated 0 times [  18] [ 0]  / answers: 1 / hits: 29533  / 2 Years ago, mon, may 2, 2022, 5:08:15

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 ?


More From » ecryptfs

 Answers
3

Actually ecryptfs tells you very specifically what to do when you run ecryptfs-setup-private --undo, just follow its instructions.




Obtain your Private directory mountpoint



$ PRIVATE=`cat ~/.ecryptfs/Private.mnt 2>/dev/null || echo $HOME/Private`



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 run echo $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.




Ensure that you have moved all relevant data out of your $PRIVATE directory




This is important.




Unmount your encrypted private directory



$ ecryptfs-umount-private



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.




Make your Private directory writable again



$ chmod 700 $PRIVATE



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.




Remove $PRIVATE, ~/.Private, ~/.ecryptfs



Note: THIS IS VERY PERMANENT, BE VERY CAREFUL



$ rm -rf $PRIVATE ~/.Private ~/.ecryptfs



This does exactly what it says. rm command means ReMove, -r means recursive (to recursively remove directories), and f means Force ("stop nagging me, just delete it"). This will remove all these three directories: $PRIVATE, ~/.Private, ~/.ecryptfs



If 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).




Uninstall the utilities (this is specific to your Linux distribution)



$ sudo apt-get remove ecryptfs-utils libecryptfs0



This will remove ecryptfs-utils and libecryptfs0. 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.


[#38896] Tuesday, May 3, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
stantildlike

Total Points: 363
Total Questions: 135
Total Answers: 120

Location: Pitcairn Islands
Member since Fri, Dec 17, 2021
2 Years ago
;