-----Original Message----- From: pelibali [mailto:pelibali@freemail.hu] Sent: Tuesday, November 01, 2005 4:38 PM To: SUSE e-list Subject: [SLE] Script doing tons of scp jobs.
Hi, I have a working, but extremely user-annoying bash-script, consis- ting of 20-25 scp lines combined with few "ssh hostname 'command'" -type commands. Is there please an easier way to achieve the above scp/ssh jobs without to be asked for the password several (=many) times? I wouldn't like to change ssh's default behaviour for asking pass- word(s), even for root; but started to be very annoyed by my own idea to make such a script to "accelerate" my todos. Please help:)
Thanks, Pelibali
Key Exchange authentication is probably what you're looking for. Basically, allows a user on serverA to be trusted to authenticate as a certain user on serverB. The steps, briefly: 1) serverA: `ssh-keygen -t dsa` and hit enter a couple of times to save the key, with the default file names and etc, to ~/.ssh/ 2) serverA: `scp ~/.ssh/id_dsa.pub destinationuser@serverB` 3) serverB: `cat ~/id_dsa.pub >> .ssh/authorized_keys2` 4) serverA: `ssh destinationuser@serverB` and watch the connection happen without requesting a password. Key Exchange is good, wonderful, and secure _assuming_ that you have good physical security on your machines. That's a very, very key point. Don't share a key from your laptop, say, to a server that's accessible to the outside world on port 22.