[OT] SSH login script - Help

Mikkel L. Ellertson mikkel at infinity-ltd.com
Sun Apr 26 16:18:46 UTC 2009


Bill Davidsen wrote:
> Dan Track wrote:
>> Hi Guys,
>>
>> I've written a simple for loop see below:
>>
>> for i in orion earth;do scp /etc/hosts /etc;done
>>
>> I have a small scripting knowledge so would appreciate some help. What
>> I'd like to do is somehow change the above so that the script prompts
>> me for a password and when I give the script the password it will use
>> it to auto-reply to any password promtps that scp asks for when
>> logging into all the servers. If I am right I believe readline needs
>> to be used. If it can't be done in bash can you give me a perl
>> alternative please.
>>
> Is there a benefit from not just using a login key (in authorized keys)
> to eliminate the need for passwords and also have the security of a
> single command which could be executed using the key?
> 
It depends on what you are trying to do. If it is a task that you do
often, then it is worth while. But for tasks like this, that you do
infrequently, it is handy to have a key pair with a good pass
phrase. You use ssh-agent and ssh-add to unlock the key before
running the script, and then use ssh-add -d to lock it again when
you are done.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20090426/8078c4f3/attachment-0001.sig>


More information about the fedora-list mailing list