7

I messed up with my files... Again... Now I am concerned if I will be able to login again once I logout. Is there a way to test if the essentials files are all there?

  1. My home was encrypted during the installation (Ubuntu 12.04).
  2. By login I mean boot Ubuntu into lightdm, type my password and be able to use my files which are encrypted and should be decrypted after the login.
  3. By messed up I mean I have moved all my ".xml" files under user directory. I do not care that much for the configuration of the applications, neither for my keyboard shortcuts as I have a backup for them.
  4. I can run ecryptfs-unwrap-passphrase ~/.ecryptfs/wrapped-passphrase and it shows me the passphrase.
  5. At ~/.ecryptfs I have auto-mount auto-umount Private.mnt Private.sig wrapped-passphrase.

One Ecryptfs manual says:

$ man ecryptfs-setup-private


FILES
   ~/.ecryptfs/auto-mount

   ~/.Private - underlying directory containing encrypted data

   ~/Private - mountpoint containing decrypted data (when mounted)

   ~/.ecryptfs/Private.sig - file containing signature of mountpoint passphrase

   ~/.ecryptfs/Private.mnt - file containing path of the private directory mountpoint

   ~/.ecryptfs/wrapped-passphrase - file containing the mount passphrase, wrapped with the login passphrase

   ~/.ecryptfs/wrapping-independent  -  this  file  exists  if  the wrapping passphrase is independent from login passphrase

May be those all are the required files?

Edit:
I rebooted the computer and although I have lost the configuration of applications and Keyboard Shortcuts I was able to login again. So I can say that no xml file is needed to login into an Ubuntu encrypted home.
But the question remains valid: is there a way to test if one will be able to login in the next boot?

  • What did you "mess up"? Are you asking about log in (pam, gdm, lightdm, kdm?) or encryption (ecryptfs)? Please clarify your problem and question. More likely then not the bottom line is going to be to log out an try it. If you can not log in you will have to boot to recovery mode and fix the problem, but hard to tell from what little you posted. – Panther Apr 10 '14 at 16:54
  • @bodhi.zazen Thank you Bodhi, I clarify the problem in my question now. – desgua Apr 10 '14 at 17:07
  • I am not sure how those configuration files would cause a problem with decrytping you home directory. You can not really "test" ecryptfs (encryption) without loging out because if you log in to a terminal, or ssh, while you remain previously logged in, the files will remain decrypted. You could probably manually re-encrypt yoru /home directory, but doing so while logged into X is going to be more hassle then it is worth. – Panther Apr 10 '14 at 17:17
  • @bodhi.zazen Do you know which are the "essentials" files of ecrypts? – desgua Apr 10 '14 at 17:24
  • As far as I know, the only essential files / directories in your home directory are in .Private and .ectyptfs See - blog.dustinkirkland.com/2009/06/… and askubuntu.com/questions/138950/… but as you are not having a problem ... – Panther Apr 10 '14 at 18:08
1
+50

One possibility is to copy your entire home folder into another system (or virtual system), and see if you can log into this system.

This is not ideal and suffers from a few shortcomings.

  • It's not very convenient, as you would need to install a parallel system, and copy across an entire home folder (although you could exclude personal documents).
  • Since you don't want to risk logging out, the copied home directory will be copied from its "mounted" state, which might differ from the "logged out" state. However, I imagine that this is equivalent to a situation where your computer crashes and your home folder is preserved in its "mounted" state. I imagine that if it can mount after this pseudo-crash, then it should mount under normal circumstances.
  • I will give you the bounty because it is the best answer so far although I think that there must be a better way to check it. Congratulations! – desgua Apr 18 '14 at 23:57
  • @desgua. This won't work because you are forgetting that the installed files are in system folders and files so you need to replicate the entire system if that is to work. There are build system's for testing in the way you seek to describe. As far as I know ubuntu don't use one, gnome do and so do opensuse – Magpie Apr 19 '14 at 1:25
  • @Magpie I guess you are right. – desgua Apr 19 '14 at 12:22
  • @desgua Thanks! (Although feel free to revoke it if there's a better answer.) I didn't say it was perfect. Anyway, to solves @Magpie's probably legitimate concerns, you could also replicate the entire system too. In my case, this makes it only slightly less feasible, since / is so small compared to ~. – Sparhawk Apr 19 '14 at 12:32
1

The is no method that I know of to do what you describe. However if you struggle to graphically login to can get around this by login in via the terminal

Step One

boot and press e i the grub dialogue.

Step Two

Move the cursor down to the line which loads your kernel.

If you don't know what to look for then it should say something like either linux or linuxefi and be a long string of various letters, numbers and spaces that look like jibberish.

the line after it should say something like initrd -( you essentially need to go to the very end of the line just before the cursor reaches newline with initrd)

Step Three

type the followin before the end of the line (from step two)

rw init=/bin/bash

Step Four

press F10 to boot

Step Five

when you are in the terminal type

login yourusername

you will be prompted for your password and this should give you access.

Step Six

Type:

startx 

to get to a graphical login

Step Seven

if that doesn't work the error in /var/logs/Xorg.0 should tell you why it did not work and help you fix the problem.

  • Thank you Magpie. The /var/logs/Xorg.0 file would be a guide in the search for a solution. But the question is if, in the future, I mess something up again, how can I test without risking loosing my files? – desgua Apr 17 '14 at 22:36
  • you won't lose your files if you are able to login via terminal – Magpie Apr 19 '14 at 1:22
0

You should be able to log in. I mean because the fact that you logged in again. I'm pretty sure those are all the needed files. I have a older version of Ubuntu and I after messing with the files was able to log in.

  • Yes I am able to login. But if, in the future, I mess something up again, how can I test without risking loosing my files? – desgua Apr 17 '14 at 22:34
  • You may be able to copy the log in files and test them on a vurtal machine. – gb26 Apr 19 '14 at 16:22

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.