Difference between revisions of "How to configure login without password and distributed control"

From IridiaWiki
Jump to navigationJump to search
Line 31: Line 31:
 
save the following to a file called cmd
 
save the following to a file called cmd
   
<nowiki>
+
<nowiki>#!/bin/sh</nowiki>
#!/bin/sh
 
   
if (( $# < 1 )) ; then
+
<nowiki>if (( $# < 1 )) ; then</nowiki>
   
echo "usage $0 command to send to the hosts listed in the hosts file"
+
<nowiki>echo "usage $0 command to send to the hosts listed in the hosts file"</nowiki>
   
exit 1
+
<nowiki>exit 1</nowiki>
   
 
<nowiki>fi</nowiki>
fi
 
   
for host in `cat hosts` ; do
+
<nowiki>for host in `cat hosts` ; do</nowiki>
   
ssh root@sbot$host $@ &
+
<nowiki>ssh root@sbot$host $@ &</nowiki>
   
  +
<nowiki>done</nowiki>
done
 
</nowiki>
 
   
 
5)
 
5)

Revision as of 20:03, 10 January 2005

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 ~/.ssh/authorized_keys2


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