[Q] how to habdle password with SSH on batch script?

Pete Nesbitt pete at linux1.ca
Tue May 11 00:28:35 UTC 2004


On May 10, 2004 10:34 am, bbaa aaa wrote:
> I plan to use "ssh" on batch script to call remote computer execute another
> script.  I still have problem on "ssh" password.  the command I use is
> similiar to:
>
>    ssh -l user1 172.2.4.40 date
> user1 at 172.2.4.40's password:     <== system pop-up to ask
>
> How can I handle this on batch file?
>
> Thanks.
>
> _________________________________________________________________
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
> http://join.msn.com/?page=features/virus


You want to use key based authentication instead of password based. You can 
set a pass-phrase for the key, or for scripts you can run without a 
pass-phrase. This can still be made secure. I have a  couple docs on this at 
under the "Documents" link at linux1.ca (http://nesbitt.yi.org/howto.shtml)
Look at "SSH/SCP via Key Authentication HOWTO" and maybe "Limiting SSH Access"

Hope that helps.
-- 
Pete Nesbitt, rhce





More information about the redhat-list mailing list