Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to automatically mount an encrypted partition on the server when logging in using SSH keys instead of the regular password?

The home folder is a luks-encrypted partition. The current pam_mount setting is as follows:

<volume user="name" path="/dev/mapper/my_folder" mountpoint="~" />
share|improve this question

2 Answers 2

~/.ssh/authorized_keys allows you to specify the command that will execute upon ssh login.

You can write a shell script that will mount partition (even ask a password for it) and then "exec bash" or "exec zsh" etc.

share|improve this answer

It puts another tool into the mix, but using sec might be an option.

"Install sec. Visit the author's website and read the documentation there. Set up sec to monitor /var/log/auth.log and run your script."

from here: http://ubuntuforums.org/showthread.php?t=843736

you could have it run a mount script and add a keyfile for the luks volume to get past entering a password.

That's the best I've got...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.