Hi there, if i understood your problem, i think it can be solved by creating a simple script using the OpenSSH secure file copy scp
command.
If all the team needs the same permissions to the same servers then my recommendation is:
- create an authorized_keys file in your own computer.
- update that file by the teams needs manually. (can use a script for that two).
Create a script to auto copy the updated authorized_keys from your computer to your servers:
scp
needs permissions to the servers to work out, that's why the script should run from your or any other manager computer.
Locate the script in /usr/local/sbin/.
on your machine, for the option to run the script from any directory on your pc.
Give the script an execute permissions by the command chmod a+x /usr/local/sbin/scriptName
.
#/bin/bash!
read -p "Please Enter Path:" -r r1
scp $r1 username@serverip:/home/username/.ssh/authorized_keys
#scp $r1 username@serverip:/home/username/.ssh/authorized_keys
#scp $r1 username@serverip:/home/username/.ssh/authorized_keys
#add more servers if needed....
#you could also use a switch to use which servers are relavent for the new user.
Note that if you are running your ssh service on other ports from security or other reasons you should run the scp
command with -P
option.
scp -P sshPort $r1 username@serverip:/home/username/.ssh/authorized_keys
.
Example picture of the script running on my own server:
- As i said before you can make the script better and add some filters by "switch" to choose which servers you wanna add the keys to.
- If the situation is simple as you said, and each team member that joins need permissions to all the servers, this solution should work out.
Hope that will help you out mate.
Please comment if anything is not understood or need any more help on this case.