LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-18-2024, 07:51 AM   #1
rksim
LQ Newbie
 
Registered: Mar 2024
Posts: 2

Rep: Reputation: 0
Angry Having an issue automounting an encrypted directory with fstab: SLES12.5


Hi Everyone! I am on SLES12.5 and could use some serious help.

I was given an existing golden image and told to setup data at rest encryption on the /home directory and the /DATA(our custom Data dir). It was also requersted that I not use a keyfile but make the user enter the password on boot. I did not want to break the system so I decided I would create a new partition for /home and start from there. it ended up being sda9. I used luks to encrypt the partition. opened the partition, mounted it manually successfully.

I created the entry in the /etc/crypttab file as follows:

Code:
luksHome /dev/sda9 none luks
I created the entry in the /etc/fstab file as follows:
Code:
/dev/mapper/luksHome /mnt ext4 nosuid,nodev,acl,user_xattr 1 2
I ensured the boot.crypto init script was installed from here and was enabled:
OpenSuse boot.crypto github

The system starts to boot normally, and pauses durring boot to ask me to enter the encryption passphrase. Upon successfully entering the passphrase boot continues and does the following:

Code:
WARNING: Locking directory /run/cryptsetup is missing!
Enter passphrase for /dev/sda9: You are in emergency mode after login type journalctl -xb to view system logs.
Trying to enter the passphrase just reprompts for the passphrase. if you get it wrong 3 times it will then let you log in as the root user like normal rescue mode.
Running an ll on /dev/mapper to find luksHome you can see it hasnt unlocked and mapped the drive yet.

Code:
ll /dev/mapper/
control
IF I then go and comment out the fstab entry for /dev/mapper/luksHome and reboot, the system boots as expected. It Pauses booting to ask for the password and continues to boot successfully. Once logged into the OS, I open a terminal, su to root, and run the ll on /dev/mapper again.

Code:
ll /dev/mapper/
control
luksHome
Can Anyone at all tell me what I am doing wrong? I am almost positive it it is in the /etc/fstab entry, but the entry looks ok and I have even tried the enrty as follows with no success. This stuff is usually my bread and butter so saying i have reached peak frustration is an understatement.

Code:
/dev/mapper/luksHome			  /testluksmnt	       ext4	  defaults			     1 2
Thanks again!

Last edited by rksim; 03-18-2024 at 07:53 AM.
 
Old 03-19-2024, 06:12 AM   #2
viel
Member
 
Registered: Jul 2021
Location: Arcadia
Distribution: Slackware
Posts: 46

Rep: Reputation: Disabled
Hi,

Can you see how the partition has mounted when it is not in fstab?

Compare with the fstab commented line to see what change, maybe you need to update it.

Hope that helps.

Viel.
 
Old 03-19-2024, 02:28 PM   #3
rksim
LQ Newbie
 
Registered: Mar 2024
Posts: 2

Original Poster
Rep: Reputation: 0
Hi, I can mount it manually and even run mount -av and get a successful mount with no issues. I have a feeling that the OS is trying to mount the partition before it is decrypted but im not sure how to fix the order of operations there.
 
  


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
sles12 , connect to wifi. urgent Ankit yadav Linux - Hardware 11 07-09-2017 10:23 AM
suse sles12 - wifi connection - urgent Ankit yadav Linux - Newbie 2 07-08-2017 08:14 AM
SLES12 Enterprise VNCSERVER command line mikenash Linux - Enterprise 0 09-15-2015 11:45 PM
Cannot mount unencrypted directory to encrypted home directory with fstab? Daravon Ubuntu 35 09-14-2010 03:50 AM
Automounting directory in fstab troubles cjtemple Linux - Newbie 9 01-07-2007 03:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:11 AM.

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