User avatar
Posts: 66
Joined: Thu Apr 05, 2012 9:41 am
Location: Germany

ssh via multiple authorized_keys

Fri Dec 21, 2012 9:40 am


I have a Rpi-Server which I like to approach in 2 ways, through ssh and sftp both by different users. So I have sftp access in a chroot environment with a public key which I give outside and ssh access with an extra public key just for me (x forwarding included).
So far the sftp part is working but how can I accomplish the second part? Managing another public key on the same host?


Posts: 13
Joined: Mon Jul 16, 2012 4:52 pm

Re: ssh via multiple authorized_keys

Mon Dec 24, 2012 10:44 pm

Have you looked into the creation of a config file in .ssh? This should sort it out.

Posts: 359
Joined: Mon Dec 03, 2012 2:47 am
Location: Elgin, IL USA

Re: ssh via multiple authorized_keys

Thu Dec 27, 2012 2:18 am

Each user should have their own keys in the .ssh folder in their home directory. Their ~/.ssh should have 700 permission and any files in it should have 600 permission (in other words no permissions for anyone other than that user).

If you have some sort of common guest account for multiple people using a common key, the .pub key for that should be in that guest user's ~/.ssh/authorized_keys (each key on one long line) on the server (the private key would be the one you give out to them). In /etc/passwd the home directory for that guest user should be the default directory they connect to with sftp and their shell should be /bin/false if you do not want them to be able to log into a shell.

Return to “Networking and servers”