Created
January 22, 2024 06:54
-
-
Save yetimdasturchi/eb4742e19e0b4207ddd333b9aca56f4b to your computer and use it in GitHub Desktop.
Ssh kalitlarni serverlar massiviga ko'chirish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
username="root" #ssh uchun foydalanuvchi | |
ssh_key_path="/home/$USER/.ssh/id_rsa.pub" #ssh kalit | |
# serverlar ro'yxati | |
servers=( | |
server1.domain.uz | |
server2.domain.uz | |
server3.domain.uz | |
) | |
for server in "${servers[@]}" | |
do | |
echo "SSH kalitni $server serveriga ko'chirish..." | |
ssh-copy-id -i $ssh_key_path $username@$server | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment