LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-08-2023, 06:58 AM   #1
andrew262
LQ Newbie
 
Registered: May 2014
Posts: 10

Rep: Reputation: Disabled
How to decrypt home folder


Hi,

I installed Ubuntu 12.04 on a 2TB drive and encrypted the home directory.

Shortly I couldn't login any more, so to recover the encrypted directory.the 2TB drive has been installed as a second drive in another Ubuntu system.

I navigated to the encrypted home directory and in the folder /home/adrian/ found the files:

/cache
/Access-Your-private-Data.desktop
/README.txt
/.ecryptfs
/.private
/.ecryptfs/adrian/.ecryptfs
/auto-mount
/auto-umount
/Private.mnt
/Private.sig
/wrapped-passphrase
/.wrapped-passphrase.recorded
/.Private/
/ Access-Your-private-Data-Desktop
/ README.txt

Access-Your-private-Data.desktop file contains:

[Desktop Entry]
_Name=Access Your Private Data
_GenericName=Access Your Private Data
Exec=/usr/bin/ecryptfs-mount-private
Terminal=true
Type=Application
Categories=System;Security;
X-Ubuntu-Gettext-Domain=ecryptfs-utils


README.txt file contains:

THIS DIRECTORY HAS BEEN UNMOUNTED TO PROTECT YOUR DATA.

From the graphical desktop, click on:
"Access Your Private Data"

or

From the command line, run:
ecryptfs-mount-private



I opened a terminal and fired some commands:

1. fdisk command:


adi@adi-1:~$ sudo fdisk -l
[sudo] password for adi:

Disk /dev/sdb: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: WDC WD20EARS-00M
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x00080dae

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 1945403391 1945401344 927.7G 83 Linux
/dev/sdb2 1945405438 1953523711 8118274 3.9G 5 Extended
/dev/sdb5 1945405440 1953523711 8118272 3.9G 82 Linux swap / Solaris

Partition 2 does not start on physical sector boundary.


2. sudo ecryptfs-recover-private command launched from the 2TB drive:


adi@adi-1:/media/adi/d2bc773c-93e3-43e2-b1bc-e2d2430030cb/home$ sudo ecryptfs-recover-private
INFO: Searching for encrypted private directories (this might take a while)...
find: ‘/run/user/1000/gvfs’: Permission denied
adi@adi-1:/media/adi/d2bc773c-93e3-43e2-b1bc-e2d2430030cb/home$


3. sudo ecryptfs-mount-private command launched from the 2TB drive:


adi@adi-1:/media/adi/d2bc773c-93e3-43e2-b1bc-e2d2430030cb/home$ sudo ecryptfs-mount-private
[sudo] password for adi:
ERROR: Encrypted private directory is not setup properly
adi@adi-1:/media/adi/d2bc773c-93e3-43e2-b1bc-e2d2430030cb/home$


Apparently there is a permission issue.

Could you let me know what commands to use and how to fix the permission issue.

Thanks,

Andrew

Last edited by andrew262; 06-08-2023 at 07:00 AM.
 
Old 06-08-2023, 06:23 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,164

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Try it as
Code:
sudo ecryptfs-recover-private /media/adi/d2bc773c-93e3-43e2-b1bc-e2d2430030cb/home/adrian/.Private
You don't need to be cd'd into it IIRC.
 
Old 06-15-2023, 06:47 AM   #3
andrew262
LQ Newbie
 
Registered: May 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
Hi syg00,

thanks for your help.

Tried the command line you provided and got another permission issues:

adi@adi-1:~$ sudo ecryptfs-recover-private /media/adi/d2bc773c-93e3-43e2-b1bc-e2d2430030cb/home/adrian/.Private
INFO: Searching for encrypted private directories (this might take a while)...
find: ‘/run/user/1000/gvfs’: Permission denied
find: ‘/run/user/1001/doc’: Permission denied
find: ‘/run/user/1001/gvfs’: Permission denied

I googled for these issues and all the explanations were beyond my understanding.

Could you advise how could I fix these issues,

Thanks,

Andrew
 
Old 09-18-2023, 09:33 AM   #4
drrummer
LQ Newbie
 
Registered: Jan 2021
Posts: 23

Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
Try it as
Code:
sudo ecryptfs-recover-private /media/adi/d2bc773c-93e3-43e2-b1bc-e2d2430030cb/home/adrian/.Private
You don't need to be cd'd into it IIRC.
Hi. I'm having a similar issue. The above code works for me. However, when it mounts the folder at /tmp/..., there is nothing in it. Even though there are a tonne of files in there. Any idea why this is happening ?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mutt unable to decrypt emails "Could not decrypt PGP message" frddbbbl Linux - Software 3 07-25-2019 10:48 AM
Store ecryptfs files inside home folder when enabling full home folder encryption in Linux Murz Linux - Security 4 10-27-2018 03:57 AM
Decrypt <user> folder in /home - Ubuntu 14.04 Danniel Linux - Security 5 09-20-2014 06:55 AM
How to decrypt home folder? kristenbb Linux - Newbie 13 05-28-2013 01:33 PM
Home folder icon does not open home folder CiscoGeek Linux - Newbie 3 12-18-2006 07:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration