2

I probably did a few things wrong on my Ubuntu installation, and I hope that someone here can help me fix that. I'll try to describe in details what I did, if you need more technical detail ask me in comments; I suppose I can edit the message and provide some logs or the results of certain specific commands if that helps for the diagnostic.

(1) Upgraded to Ubuntu 18.04

For a few weeks I've got the warning message from Dropbox stating that it will stop working in my system, and after research, I understood that it was because I was using encryption via ecryptfs (I was on Ubuntu 16.04, using ext4 file system). Note that I do not really understand how ecryptfs works; encryption via .ecryptfs was very probably done automagically when I installed 16.04. Though I still have (in an external HD) a textfile with a passphrase for encryption (this is a 32-digits hex number) that I probably saved at that time.

I've read that Ubuntu 18.04 solves this Dropbox issue because it doesn't use ecryptfs (rather LUKS, which is global encryption and accepted by Dropbox). Anyway, I don't really care (for the time being) about encryption, I just wanted to be able to continue using Dropbox without going to the hassle of quickly finding and installing an alternative. So I upgraded to Ubuntu 18.04 a few days ago. It went well (except for a notable slowdown, apparently partially because of the process baloo_file_extractor, but this is another story).

But this didn't solve the issue since I still had ecryptfs encryption installed, and still got the warning message from Dropbox.

(2) Tried to remove ecryptfs encryption

(In retrospect I should have asked here or another forum how to do that: the only helps I found via google searching were rather old and maybe obsolete and unreliable.) I followed (to the letter) the following how-to: https://www.howtogeek.com/116179/how-to-disable-home-folder-encryption-after-installing-ubuntu/

  • created a backup copy (/home/vivien.backup) of the /home/vivien directory
  • logged out, and logged in to another admin account
  • deleted the /home/vivien directory
  • deleted the folder /home/vivien.backup/.ecryptfs
  • sudo apt-get remove ecryptfs-utils libecryptfs0
  • sudo mv /home/vivien.backup /home/vivien

Note: After deleting the folder /home/vivien.backup/.ecryptfs I noticed that there was another .ecryptfs folder, inside the /home folder (but not inside the vivien/ or vivien.backup/ ). I was not sure whether I should delete it as well, so I didn't delete it.

(3) First results (could log in, but lost configuration files)

When I logged in again in my normal account, it was as if I had reinstalled Ubuntu from scratch (every change in the configuration that I had done was not there anymore, I got the default configuration, and even the welcome messages of Ubuntu). So I may have lost all my configuration files. In particular, all my firefox bookmarks/history had disappeared (fortunately I had a back-up via Firefox Sync). This is not my main issue though. I also noticed everything was very (very) slow. So after maybe 30 minutes I decided to reboot.

(4) Second results (after rebooting, cannot log in)

When I wanted to log in again, this didn't work: namely, I click on my name, I enter my password, the screen becomes black and then displays again the login screen. I logged in to the secondary admin account. This is what I get:

root@Cleobule3:~# cd /home/vivien/
root@Cleobule3:/home/vivien# ls
Access-Your-Private-Data.desktop  README.txt

And these two files are unreadable. For example, if I click on the read-me file in Nautilus (launched as root), I get a pop-up window that says: "The link "README.txt" is broken. Move it to Trash? The link cannot be used because its target "/use/share/ecryptfs-utils/ecrypts-mount-private.txt" doesn't exist."

If I look into the /home folder, there is still the .ecryptfs folder:

root@Cleobule3:~# cd /home
root@Cleobule3:/home# ls -all
total 20
drwxr-xr-x  5 root      root      4096 Nov  7 01:59 .
drwxr-xr-x 24 root      root      4096 Oct 29 00:35 ..
drwxr-xr-x  3 root      root      4096 Jun 17  2017 .ecryptfs
drwxr-xr-x 18 tempadmin tempadmin 4096 Nov  7 11:16 tempadmin
dr-x------  3 vivien    vivien    4096 Nov  7 09:45 vivien
root@Cleobule3:/home# cd .ecryptfs/
root@Cleobule3:/home/.ecryptfs# ls
vivien
root@Cleobule3:/home/.ecryptfs# cd vivien/
root@Cleobule3:/home/.ecryptfs/vivien# ls -all
total 36
drwxr-xr-x  4 vivien vivien  4096 Jun 17  2017 .
drwxr-xr-x  3 root   root    4096 Jun 17  2017 ..
drwx------  2 vivien vivien  4096 Nov  6 08:09 .ecryptfs
drwx------ 30 vivien vivien 20480 Nov  7 09:36 .Private
root@Cleobule3:/home/.ecryptfs/vivien# cd .ecryptfs/
root@Cleobule3:/home/.ecryptfs/vivien/.ecryptfs# ls -all
total 20
drwx------ 2 vivien vivien 4096 Nov  6 08:09 .
drwxr-xr-x 4 vivien vivien 4096 Jun 17  2017 ..
-rw-r--r-- 1 vivien vivien    0 Jun 17  2017 auto-mount
-rw-r--r-- 1 vivien vivien    0 Jun 17  2017 auto-umount
-rw------- 1 vivien vivien   13 Jun 17  2017 Private.mnt
-rw------- 1 vivien vivien   34 Jun 17  2017 Private.sig
-rw------- 1 vivien vivien   58 Jun 17  2017 wrapped-passphrase
-rw-rw-r-- 1 vivien vivien    0 Jun 17  2017 .wrapped-passphrase.recorded

And in /home/.ecryptfs/vivien/.Private there are a lot of files with weird names that are very probably my encrypted files.

I guess all this must make sense to someone who understands the ecryptfs encryption, but as a relative noob I feel overwhelmed. Did I lose all my files (well, I have some partial back-up somewhere, but not all), or is there a way to salvage this mess? I see that there are some similar questions here, but I'm a bit hesitant now of trying random things without the help of someone who knows what they're doing. Thank you in advance for any help.

3
  • Well, I tried the most obvious thing that I dared to try, which was to reinstall ecryptfs-utils (from the secondary admin account). It solved at least my most urgent issue (I can now log in in my normal account again). Should I answer myself?
    – ViV
    Nov 7, 2018 at 20:36
  • If you can now log in, and if that was the main question (tl;dr) then you should probably answer if it's solved now. About the dropbox problem, all you have to do is move dropbox's synced folder to an ext4 filesystem, there's a few requirements for it (some attributes needed, maybe should be 2 folders "deep" in ext4) but it's not a "ditch my whole Ubuntu and start over" problem
    – Xen2050
    Nov 9, 2018 at 16:45
  • Thanks @Xen2050. As for the Dropbox issue, if I understood correctly, it's combination of ext4 + encryption with ecryptfs that is not accepted by Dropbox. After googling, it seems that the solution is either to find an alternative to Dropbox, or to deactivate the ecryptfs encryption. (I find either of that quite annoying, but this is not the matter of this question).
    – ViV
    Nov 9, 2018 at 19:52

1 Answer 1

2

I solved the problem myself, inspired by the discussion in another question (I accidentally removed my ecryptfs-utils package. Now I cannot log in. Any chance to regain access to the home directory?)

I simply reinstalled ecryptfs-utils, using my secondary admin account. I was not sure this would work (the discussion seems to imply that the method of encryption of ecryptfs may depend on the version, so trying to decrypt with a newer version might not work). But after rebooting I was allowed to log in again with my primary account. This doesn't solve my initial issue, but this answers the question here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.