Linux – SSH without password (shared home folder)

linuxsshssh-keys

I have a question about passwordless ssh with one home folder.

I have created a common /home/developers account, and multiple users (developerA,developerB …). All developers have been delegated the same home folder (/home/developers).

As developerA on his machine, I have done the following:

  1. ssh-keygen -t rsa -f developerA -C developerA@mycompany.com
  2. (on server). added the .pub to the server /home/developers/.ssh/authorized_keys file
  3. ssh developerA@myServer -i developerA

I am thinking that the problem is linked to permissions, because the authorized_keys file is owned by developers (-rw——- 1 developers developers 2033 Nov 11 22:55 authorized_keys
)

Does anyone have a solution to this problem, or how to go about multiple-user passwordless ssh without creating a home folder for each of them.

Thanks in advance guys

Best Answer

You only have one user. So it's not a multiple users problem. Make sure the .ssh directory has mode 700.

However, you're doing it wrong anyway. You should create different users for each developer and put them in a common group. If they need to work on the same files, you make them writable by their common group and put them in a directory that has the "set group ID" flag set, so whatever they write to it will belong to the group.

Related Question