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="~" />
link|improve this question

55% accept rate
feedback

2 Answers

~/.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.

link|improve this answer
feedback

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...

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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