Re: Question about bash, for loop script to repeat on 20 Pla
server : alecto
server's user: test
PC
for each PC :
0. enable sshd (user root)
/etc/init.d/sshd start
1. generate key RSA (user test):
ssh-keygen -t rsa
command ssh-key make directory .ssh in the home of test user
2. Copy key public in server
with test is your user
with alecto is your hostname of server.
scp ~/.ssh/id_rsa.pub
test@alecto:/home/test/.ssh/authorized_keys_pc1
witch
pc1 for pc1
pc2 for pc2
.....pc20
*****************************
on server
cat the content of 20 files: authorized_keyspc1+authorized_keyspc2+authorized_keyspc3+... in the /home/test/.ssh/authorized_keys
script
****************************
for i in (1:20)
do
scp file_to_copy test@10.0.0.$i:/home/test
done
*****************************
with file_to_copy is el filename
Finally use ssh without having to type in your password everytime
enjoy
see: h**p://www.cs.umd.edu/~arun/misc/ssh.html