shell - Batch script to log in SSH server on Windows -


i'm trying make batch script log in ssh server , execute few commands. start command is:

plink -ssh user@99.99.999.99

then need enter user name , password image:

ssh

if have 'user name' , 'password' in 2 variables, how use them when asks me for?

[edit]

last try this:

(echo username echo mypassword) | plink -ssh user@99.99.999.99 

output:

user name:username mypassword password: 

the batch didn't "pressed" enter after inputing username.

try

plink -ssh -l $user -pw $passwd 

after setting environment variables

set user=name set passwd=secret 

see http://the.earth.li/~sgtatham/putty/0.58/htmldoc/chapter7.html


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -