I recently set up a new server with Ubuntu karmic 9.10, and when I created my home directory I chose to make it encrypted. Now, after loading my authorized_keys file into ~/.ssh, it isn't recognized because my home directory isn't decrypted until after I log in. Is there a way to make SSH keys work with encrypted home directories under Ubuntu?
|
up vote
3
down vote
favorite
1
|
|
|
up vote
6
down vote
accepted
|
Change this line in your sshd_config file:
And then move your authorized_keys file to /etc/ssh/your-username/authorized_keys This post documents another way to solve this. |
||
|
up vote
0
down vote
|
I just spent some time messing around with this, and the answer is that it's pretty much fundamentally impossible. It is possible to set up passwordless public-key-authenticated logins via ssh, so you don't have to type in your password to log in, but that doesn't get you anywhere, because your home directory is still encrypted. The simple fact is that your encrypted home directory is encrypted with a password*, so the only way to decrypt it is with that password. And if you're thinking that in theory it should be possible to use your ssh key to decrypt the mount passphrase upon login, that won't work because your private key is never sent to the server at all. So basically, if you want encryption, you have to use passwords. Encrypted home directories are incompatible with fingerprint logins for the same reason. *I know it's more complicated than a single password, but let's keep it simple for now. |
||||||||||
|
|
up vote
0
down vote
|
But you can use the more secure public key to login, and then execute 'ecryptfs-mount-private' to mount your directory after you type in your password. Read the '~/README.txt' file after you login via ssh and find that you don't have your files because the encrypted directory is not mounted. You shouldn't be using passwordless public-keys to login anyway. Look at ssh-agent for a better way. |
||
|
|
|
up vote
0
down vote
|
So djhowell's link worked, but I can't log in twice. I'm going to have to rethink how I really want to handle the encryption stuff. |
||
|
|
ubuntutag but i don't think this problem is specific to any particular OS. – quack quixote♦ Oct 26 '09 at 20:46