#Home directory encryption

189 messages · Page 1 of 1 (latest)

hasty yoke
#

I recently reinstalled mint on my system, during which I mistankingly checked the box that encrypts the home directory, and I'd like to undo that but don't know how.

ivory hollow
hasty yoke
#

As well as other programs for daily use like lutris, bottles, steam etc

ivory hollow
# hasty yoke I didn't, and i have save files on my home folder that i'd like to keep \:')

sadly, i got no experience of en- or decryption. but i think preparing a usb memory stick with a live linux on it as a precaution doesn't hurt. and you will maybe need a separate, non-encrypted partition. i imagine that if files are not individually encrypted you need only copy all files from an encrypted partition to a regular partition, so the files get automatically decrypted. i have to try that out by myself, but i'm stuck with too few disks...
wait for the pundits in here, maybe prepared with some neceessary data points. could you open a terminal and type:

  • df -h
  • inxi -Fxxxz
  • lsblk -f
  • sudo parted -l
    (that's all i know)
ivory hollow
# hasty yoke

okay, then

  • sudo parted -l
  • sudo pvscan
  • sudo lvscan
  • sudo vgscan
    they do not manipulate data, the commands show only some data points so we know what partition is with which method encrypted and such. these commands will put out data beyond my knowledge so wait for stunner, maniak, curunir, sedenion, jeremyb, temmie, etc.
hasty yoke
ivory hollow
# hasty yoke

so...
/dev/sda1: is the partition 'bios_grub' but doesn't show up in lsblk -f? idk why!
/dev/sda2: lsblk -f and parted show the same, okay.
/dev/sda3: is in ext4 format and has 310 GB in lsblk -f and 512 GB in parted? idk why!

and idk why pvscan, lvscan, vgscan don't show any output! the same non-output than in my non-encrypted system!? shrugcat

hasty yoke
#

I also don't know what some (most) of those outputs mean 💪

ivory hollow
hasty yoke
#

Alright

ivory hollow
haughty widget
#

The thing would do, is to backup home data into another non-encrypted location...

#
  1. Obtain your Private directory mountpoint
    $ PRIVATE=`cat ~/.ecryptfs/Private.mnt 2>/dev/null || echo $HOME/Private
    
  2. Ensure that you have moved all relevant data out of your $PRIVATE directory
  3. Unmount your encrypted private directory
$ ecryptfs-umount-private
  1. Make your Private directory writable again

$ chmod 700 $PRIVATE

5. Remove `$PRIVATE, ~/.Private, ~/.ecryptfs`
 Note: THIS IS VERY PERMANENT, BE VERY CAREFUL
 ```
$ rm -rf $PRIVATE ~/.Private ~/.ecryptfs
  1. Uninstall the utilities (this is specific to your Linux distribution)

$ sudo apt-get remove ecryptfs-utils libecryptfs0

#

That ⬆️ is the procedure to revert/undo home encryption... But before doing that, you must backup all your home data to safe (unencrypted) location.

#

Some people simply copies the /home/user to another home folder, for exemple :

sudo cp -rp /home/user /home/user.backup

Personally, to be sure, I would rather backup the entire /home data into /opt/home in case something went wrong...

#

Tell me once you are ready to play with terminal...

hasty yoke
haughty widget
#

before we begin I would like to check some things

#

can you open terminal and type cat ~/.ecryptfs/Private.mnt and paste result here

haughty widget
#

ok... type that cat ~/.ecryptfs/Private.mnt 2>/dev/null || echo $HOME/Private

#

and show result

hasty yoke
#

Same result

haughty widget
#

ok

#

type ls ~/.ecryptfs

hasty yoke
#

I'm not really sure if screenshots or saving as .txt are the best way to share these

haughty widget
#

you can select text in terminal and copy it, to paste here

#

you can also use the middle-mouse button

#

screenshot is ok for now

#

Well, what things you must backup absolutely ?

#

well, whatever, we will backup everything... but restoring will not be as easy...

hasty yoke
#

Alright

hasty yoke
#

Like all the environment variables i set as launch options on steam and flatseal

#

Or login information on floorp and such

haughty widget
#

so, type sudo cp -rp /home/raviel /opt/raviel.backup

#

this will take a while, do not close terminal until you see the new prompt

#

do you have a phone or another computer than this one to connect to discord ?

hasty yoke
#

I do

haughty widget
#

you will need it...

#

because the other part must be done in recovery mode

hasty yoke
#

Oh man

#

Is there an easy way to boot on recovery mode

haughty widget
#

it's not that hard

hasty yoke
#

It's just that i may have to move my rig to a different monitor, my tv, since this one doesn't display the BIOS

haughty widget
#

ah, that might be a problem indeed

#

the recovery mode is in text mode

#

like que grub menu

hasty yoke
#

Figured

haughty widget
#

and you need to see the grub menu to access recovery mode

hasty yoke
#

Guess i'll be doing that once the files are done copying

haughty widget
#

yes

hasty yoke
haughty widget
#

ok

#

ready for recovery mode ?

hasty yoke
#

Sure am

haughty widget
#

You know how to go in ?

hasty yoke
#

No 💪

haughty widget
#

ok, you see the Grub Menu ?

#

when you start computer

hasty yoke
#

I do in this monitor, yes

haughty widget
#

on that menu, select "Advanced options for Linux Mint"

#

then select the first entry with (recovery mode)

#

you will end with a red menu

#

one of the option is "Drop in prompt as Root" or something like that

hasty yoke
#

Wait i confused the GRUB menu with the BIOS

#

I don't know how to get there

#

Do i press F12 during boot?

haughty widget
#

no

#

If you don't see the grub menu, press ESC at boot

#

before you see the Mint logo

hasty yoke
#

This?

#

The 0 was a typo

#

What next?

haughty widget
#

shit, I don't know, wait

#

type normal

hasty yoke
#

I'm now back to the regular mint password screen

#

🙂

haughty widget
#

ok

#

open terminal sudo nano /etc/default/grub

#

GRUB_TIMEOUT_STYLE=hidden -> GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=0 -> GRUB_TIMEOUT=5

#

then Ctrl+X confirm save

#

then type sudo update-grub and reboot

hasty yoke
#

Uh, after pressing ctrl+x and saying yes it's asking for a file name

haughty widget
#

there is no default one ?

hasty yoke
#

Ig

haughty widget
#

simply type enter

hasty yoke
#

Done

#

Double checked to see if it saved the changes and i belive it did

#

Ran the update command

#

I'll try rebooting now

#

It shows up, but it doesn't take long for the mint logo to appear and take me to the password screen

#

What do i have to select before that?

haughty widget
#

Reboot once you see the menu simply hit up or down arrow key, this stops the timer

#

you select "Advanced options for Linux Mint" then the first entry with (recovery mode)

hasty yoke
#

Done

#

The recovery menu, i think it's called in english, is open

haughty widget
#

ok, You should find an option "Drop in shell prompt as root" something like that

hasty yoke
#

There's an option that roughly says that it takes me to terminal in root mode

#

It's that one, i wager

haughty widget
#

yes, it's that

hasty yoke
#

"Control D to continue or enter for maintenance" it says

haughty widget
#

Ctrl+D

hasty yoke
#

Nothing happened? I'm still on recovery menu

haughty widget
#

retry and type enter

#

Retry until you have prompt

hasty yoke
#

Now there's a command prompt

haughty widget
#

ok

#

so we will first verify the back files

#

cd /opt

#

ls

hasty yoke
#

raviel.backup

haughty widget
#

ok, cd aviel.backup then verify files are properly readable for example, list Download files

#

ls Downloads

#

ls .steam etc..

#

it's ok ?

hasty yoke
#

Seems everything is there, yes

haughty widget
#

ok

#

here beging Armageedon

hasty yoke
#

Actually, when i type ls it doesn't list hidden folders, although they're still readable since ls .steam still yielded results

haughty widget
#

yes, to list hidden folder you must add -a options

#

you also can display as listing

#

ls -al

#

then you have the detailled list

hasty yoke
#

I see

haughty widget
#

ok, ready?

hasty yoke
#

Yes

haughty widget
#

don't mistype this one:
rm -rf /home/raviel

hasty yoke
#

Will it still work if i'm still on /opt/raviel.backup ?

haughty widget
#

yes

hasty yoke
#

Alright

haughty widget
#

if you prefer go to /home

hasty yoke
#

Done

haughty widget
#

cd /home

#

but since the supplied path is absolute (beging with /) it will understand as absolute path

#

if you typed rm -rf home/raviel without the leading / this would probably show you an error, about not existing item

hasty yoke
#

It didn't show an error message and just showed me another command prompt

#

I assume the raviel folder is gone now

haughty widget
#

so it suceed, you can verify ls -al /home it should show you only two lines . and ..

hasty yoke
#

I moved to home folder via cd /home

#

Typing ls -al shows the 2 files you mentioned plus .ecryptfs

#

I copy pasted a message of yours to do this weird font background thing :')

haughty widget
#

ok, remove .ecryptfs too rm -f .ecryptfs

hasty yoke
#

Says it can't remove .ecryptfs due to it being a directory

haughty widget
#

ah ok

#

rm -rf .ecryptfs

hasty yoke
#

Done

#

Only . and .. inside home folder now, as per ls -al

haughty widget
#

now apt remove ecryptfs-utils libecryptfs0

hasty yoke
#

Libecryptfs0 is not installed, and thus will not be removed
The following packages will be REMOVED
ecryptfs-utils yadda yadda yadda
do you want to continue? Y/n

haughty widget
#

YEs !!

hasty yoke
#

Done

haughty widget
#

wait

#

did you writen libecryptfs0 with capital ?

#

apt remove libecryptfs0 without capital, anywhere

haughty widget
#

ok

#

type apt autoremove (don't need sudo)

#

and answere Y to everything

hasty yoke
#

Well, there wasn't anything to remove

haughty widget
#

ok

#

now we move backup to home

#

mv /opt/raviel.backup /home/raviel

hasty yoke
#

Done

haughty widget
#

ok cd /home then ls -al and check that the raviel folder belong to raviel user and group

#

you should see raviel raviel

hasty yoke
#

Seems so

haughty widget
#

ok

#

type reboot and cross fingers

hasty yoke
#

I'm in

haughty widget
#

your session open ?

hasty yoke
#

Yes

haughty widget
#

everything is here ?

hasty yoke
#

Down to the last page i had opened on my browser, it looks like

haughty widget
#

marvelous

hasty yoke
#

Do i have to see the grub menu every time i boot?

haughty widget
#

now the final cleaning, open terminal

#

type : rm -rf ~/.Private and rm -rf ~/.ecryptfs (take care of capital P at Private)

#

if you want to get rid of the grub menu:
sudo nano /etc/default/grub
back menu to hidden and 5 to 0
Ctrl+X confirm save
sudo update-grub

hasty yoke
#

Directories removed and grub updated

haughty widget
#

reboot, and check everything is ok, if so, congratulation

hasty yoke
#

Things seem ok