Help with key based ssh between putty and ubuntu

postmark

Senior member
May 17, 2011
307
0
0
I'm working on a home file server that will be mirrored across the net to an machine at another house. I'm trying to be able to disable password based logins via ssh and seem to be running into an issue. I'm running Ubuntu server v13.04. It has 2 users ( 1 was from the install time and another that was added that had no sudo ability).

I'm following this guide to get the key setup for putty and the server. http://www.howtoforge.com/how-to-co...-with-putty-and-linux-server-in-5-quick-steps and it works fine for the second user account that is a restricted account. For the main account that was crated at install it works fine as long as the ssh connection that was used to disabled the password authentication in the sshd_config is still alive. But as soon as that connection is terminated then any time I try to reconnect with the same key it will reject the key. I'm only changing 2 things in the config. Disable password auth and root login.

Anyone have experience with this? I'm wondering if maybe it has to do with setting the home directory to be encrypted? But it's strange that it still works to login in with the key from the second account that is not in the sudo list.

Thanks for any help!
 

MrColin

Platinum Member
May 21, 2003
2,403
3
81
Yes, it has to do with the encrypted home folder. One workaround is to make a /etc/user/.ssh directory, chown and chmod the contents appropriately and set /etc/ssh/sshd_config to look for the keys there. you may need to mount the encrypted home of the admin user w/ the command ecryptfs-mount-private after connecting with key based auth. The second account probably does not have encrypted home.
 

postmark

Senior member
May 17, 2011
307
0
0
OK thanks. I'm not very far into my setup I think I may just reinstall with that option unselected.