[OT] SSH login script - Help

Joachim Backes joachim.backes at rhrk.uni-kl.de
Fri Apr 24 09:34:18 UTC 2009


Manuel Aróstegui wrote:
> On Fri, 2009-04-24 at 10:12 +0100, 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.
>>
>> Thanks for your help.
>>
>> Dan
>>
> 
> Hi Dan, 
> 
> You might want to use autoexpect for that.
> 
> This can get you in security problems since you'd need to write your
> password in the script, but as long as you use user and groups perms
> correctly you should kinda safe.
> 
> Manuel.
> 

Hi,

I think Dan should first read the "expect" man page where he can learn 
how to provide an expect script with passwords or keys (independent from 
all security aspects you mentioned above).

Regards


Joachim Backes <joachim.backes at rhrk.uni-kl.de>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6101 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20090424/ae48aaf9/attachment-0001.bin 


More information about the users mailing list