„setup-servers“ ändern
This commit is contained in:
parent
eed913af1f
commit
39b8aaf175
@ -15,8 +15,8 @@ ssh_key_file="/root/.ssh/id_rsa.pub"
|
||||
for server in "${servers[@]}"
|
||||
do
|
||||
echo "Adding SSH key to $server"
|
||||
ssh -o StrictHostKeyChecking=no $server "sudo mkdir -p /root/.ssh && sudo chmod 700 /root/.ssh"
|
||||
cat $ssh_key_file | ssh -o StrictHostKeyChecking=no $server "sudo tee -a /root/.ssh/authorized_keys > /dev/null"
|
||||
ssh -o StrictHostKeyChecking=no $server "mkdir -p /root/.ssh && chmod 700 /root/.ssh"
|
||||
cat $ssh_key_file | ssh -o StrictHostKeyChecking=no $server "tee -a /root/.ssh/authorized_keys > /dev/null"
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "SSH key added to $server"
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user