Trying to recover encrypted home folder
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Trying to recover encrypted home folder
Hi, everyone.
I revived an old netbook with Linux Mint 15 (Olivia) sometime last year and encrypted the disk. I can remember the passphrase for the disk but have forgotten my admin password, so while I can start Mint, I can't get past the login screen.
I tried booting from a live USB stick and changing the password from there, but so far, it isn't working. So, I tried another route, this other tutorial on recovering an encrypted home folder while using a live USB/CD.
I get as far as "sudo nemo", and I manage to find my old home folder with this file, "Access-your-private-data.desktop", inside it. Unfortunately, double-clicking it doesn't do anything. Is there something I'm missing?
I revived an old netbook with Linux Mint 15 (Olivia) sometime last year and encrypted the disk. I can remember the passphrase for the disk but have forgotten my admin password, so while I can start Mint, I can't get past the login screen.
I tried booting from a live USB stick and changing the password from there, but so far, it isn't working. So, I tried another route, this other tutorial on recovering an encrypted home folder while using a live USB/CD.
I get as far as "sudo nemo", and I manage to find my old home folder with this file, "Access-your-private-data.desktop", inside it. Unfortunately, double-clicking it doesn't do anything. Is there something I'm missing?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Trying to recover encrypted home folder
First, if you change the password for your encrypted account without being logged in with that account--you won't be able to recover the encrypted files. Else encryption would be a bit useless, as root could just change your password and access your files (so no, root can't).
You could try these steps from a LiveCD session: https://web.archive.org/web/20161216114 ... /Ecryptfs/. I'm not sure as to whether you need to know your password for that or not.
You could try these steps from a LiveCD session: https://web.archive.org/web/20161216114 ... /Ecryptfs/. I'm not sure as to whether you need to know your password for that or not.
Re: Trying to recover encrypted home folder
After following this tutorial, I'm able to open a /tmp/ecryptfs.<gibberish> folder. Unfortunately, the folders and files inside are still in gibberish.
Re: Trying to recover encrypted home folder
I haven't been able to change my password. To be honest, as a newbie, I'm pretty confused by "login passphrase" and "mount passphrase". In the simplest terms, when I turn on my netbook, I see a black screen with a lock icon and an input box, and I know the password for that. Then it starts Mint and gets to the login screen — that's the password I've forgotten.
Re: Trying to recover encrypted home folder
Below are my notes about how to recover an encrypted home folder, which I've used successfully in the past. Replace /dev/sda1 with the partition id of your home (or root if not separate) partition, and replace username with your username. If the "su - username" command asks for your password, first become root with "sudo -i" (to become root) and then try again. I can't recall if it asks for your password or not, so
Code: Select all
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RECOVERY OF AN ENCRYPTED HOME DIRECTORY WITH A LIVECD
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Mount the disk partition containing the Encrypted Home Directory
sudo mount /dev/sda1 /mnt
# Establish a proper chroot environment
sudo mount -o bind /dev /mnt/dev
sudo mount -o bind /dev/shm /mnt/dev/shm
sudo mount -o bind /proc /mnt/proc
sudo mount -o bind /sys /mnt/sys
sudo chroot /mnt
# Become the user whose data needs recovery and manually add the necessary mount
# passphrase to the kernel session keyring
su - username
ecryptfs-add-passphrase --fnek
# Mount the encrypted directory and then access the data
ecryptfs-mount-private
cd $HOME
Re: Trying to recover encrypted home folder
Thanks! I'll try this when I get home and report back.
Re: Trying to recover encrypted home folder
To set expectations right, the "ecryptfs-add-passphrase --fnek" command will ask for you to provide your mount passphrase. After the final command you can run the following command to list the files in your home directory:
If they aren't gibberish now, you can probably open your file manager here. For Cinnamon you'd run:
For MATE, replace nemo with caja. For KDE with dolphin. For Xfce with thunar. The dot in the command is to indicate the file manager should open on your current directory.
Code: Select all
ls
Code: Select all
nemo .
Re: Trying to recover encrypted home folder
Sorry, I got stuck at "Establish a chroot environment"; the terminal said that mount point /mnt/dev does not exist.
Re: Trying to recover encrypted home folder
Hm. Are you sure the command before it was correct?
In fact /dev/sda1 should be of your root partition. Do you have a separate /home partition? If you didn't do a manual partitioning during installation, the answer is no.
If you're not sure which /dev/sd?? you should use, boot from the Linux Mint DVD and run this command (that's the letter l at the end, not number 1):
That will show all your partitions in detail. The ones from the Linux Mint DVD will also be there. Probably you can spot your hard disk's root partition based on its size, else share here for help (see terminal's Edit menu for copying text).
Code: Select all
sudo mount /dev/sda1 /mnt
If you're not sure which /dev/sd?? you should use, boot from the Linux Mint DVD and run this command (that's the letter l at the end, not number 1):
Code: Select all
sudo parted -l
Re: Trying to recover encrypted home folder
Here are the results of parted -l:
Thanks for taking the time to help me, by the way.
Code: Select all
Model: ATA WDC WD1600BEVT-2 (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 256MB 255MB primary ext2 boot
2 257MB 160GB 160GB extended
5 257MB 160GB 160GB logical
Re: Trying to recover encrypted home folder
Looks like you have a separate boot partition. I think you should mount /dev/sda5. So follow my guide again but replace the first command with:
Code: Select all
sudo mount /dev/sda5 /mnt
Re: Trying to recover encrypted home folder
This time, I got "unknown filesystem crypto_LUKS". I feel so close yet so far.
Re: Trying to recover encrypted home folder
Oh... Then you don't have an encrypted home folder, but you have full disk encryption. I haven't tried this put pulled hints from http://blog.miketoscano.com/?p=72 and it may work.
Again, boot from the Linux Mint installation DVD. Open a terminal and become root with this command:
Next, run this command to unlock your partition--it should prompt for your passphrase:
Next, see which volumes are available inside the encrypted partition:
Enable the logical volume for your root partition, replace "volumename" with the name of the correct volume:
Now you should be able to mount it. Again, replace "volumename":
Your home folders from the encrypted partition should now have been mounted to /mnt and you should be able to copy files from there.
Again, boot from the Linux Mint installation DVD. Open a terminal and become root with this command:
Code: Select all
sudo -i
Code: Select all
cryptsetup luksOpen /dev/sda5 sda5_crypt
Code: Select all
lvdisplay
Code: Select all
vgchange -a y volumename
Code: Select all
mount -t ext4 /dev/volumename/home /mnt
Re: Trying to recover encrypted home folder
There wasn't a /dev/volumename/home, only a /dev/volumename/root. So, I mounted that at /mnt and then opened /mnt in nemo, but I then ran into the same problem; there's an access-your-private-data.desktop file inside that does nothing.
Re: Trying to recover encrypted home folder
Ouch... Then I've run out of ideas on how to get you your files back
Re: Trying to recover encrypted home folder
Well, thanks for all your time and help, xenopeek. I really do appreciate it. I'll just post again here if I ever find anything.