Difference between revisions of "How to configure login without password and distributed control"
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
1) |
1) |
||
+ | |||
− | + | if there is no ~/.ssh/id_rsa.pub, do |
|
ssh-keygen -t rsa |
ssh-keygen -t rsa |
||
Note: press 3 times enter in order to have the empty password! |
Note: press 3 times enter in order to have the empty password! |
||
2) |
2) |
||
+ | |||
− | + | attach the content of the file you generated (do not overwrite!) to the file |
|
− | + | /root/.ssh/authorized_keys2 (on the s-bot!) |
|
Line 14: | Line 16: | ||
1) |
1) |
||
+ | |||
make sure that you can access an sbot labeled with x, using ssh sbotx (see Halva's howto) |
make sure that you can access an sbot labeled with x, using ssh sbotx (see Halva's howto) |
||
2) |
2) |
||
+ | |||
prepare a file with the s-bots you want to use: |
prepare a file with the s-bots you want to use: |
||
Line 25: | Line 29: | ||
27 |
27 |
||
− | 3) |
+ | 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?) |
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) |
4) |
||
+ | |||
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> |
⚫ | |||
− | 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 |
||
⚫ | |||
5) |
5) |
||
+ | |||
chmod 700 cmd |
chmod 700 cmd |
||
6) |
6) |
||
+ | |||
try it: |
try it: |
||
./cmd ls |
./cmd ls |
Latest revision as of 21:04, 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 /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