How to configure login without password and distributed control

From IridiaWiki
Jump to navigationJump to search

login via ssh without password:

1)

if there is no ~/.ssh/id_rsa.pub, do ssh-keygen -t rsa Note: press 3 times enter in order to have the empty password!

2)

attach the content of the file you generated (do not overwrite!) to the file /root/.ssh/authorized_keys2 (on the s-bot!)


a script to start things in parallel on many s-bots:

1)

make sure that you can access an sbot labeled with x, using ssh sbotx (see Halva's howto)

2)

prepare a file with the s-bots you want to use:

cat hosts 16 19 26 27

3)

each time you use the script, be sure that the file is up to date - if you start programs on s-bots which somebody else is using, there will be damage (e.g. s-bot 15?)

4)

save the following to a file called cmd

#!/bin/sh

if (( $# < 1 )) ; then

echo "usage $0 command to send to the hosts listed in the hosts file"

exit 1

fi

for host in `cat hosts` ; do

ssh root@sbot$host $@ &

done

5)

chmod 700 cmd

6)

try it: ./cmd ls