DOS batch file: SSH connection, how to script to enter password when prompted?
Posted on 2004-08-26
I need to create a batch file on a Windows 2000 box which connects to linux box running an ssh (and ftp) server and uploads files in continuous loop for testing our connection.
I'm using putty's pscp to connect to transfer the files over. The problem is there is no way to specify the password on the pscp commandline. So I need to simulate its entry in the batch file as I can't have the user entering it manually everytime. This batch file isn't meant to be secure so yes the actual password will be exposed in the batch file. How can I do this? Here's what I have so far:
pscp -r C:\data userName@192.168.0.2:/home/userName/
REM enter password when prompted
Thanks for any help!