Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"sshpass is not recognized" on Windows

I want to run sshpass command from my Windows to remote Linux server. I use this command:

sshpass -p 'password' ssh ldap.nextstep4it.com -l root -o StrictHostKeyChecking=no

But my cmd return below error statement:

'sshpass' is not recognized as an internal or external command, operable program or batch file.

I think this is because Windows don't have sshpass package as Linux do. From Linux I have to install sshpass package to be able to run this command.

Is there anybody know how to run sshpass command through Windows command line?

like image 350
Ridzuan Adris Avatar asked May 02 '14 02:05

Ridzuan Adris


People also ask

Does Sshpass work on Windows?

You cant run sshpass in windows. You can however use putty via the windows command line, to achieve the same thing.

How do I run Sshpass?

Use sshpass Specify the command you want to run after the sshpass options. Typically, the command is ssh with arguments, but it can also be any other command. The SSH password prompt is, however, currently hardcoded into sshpass .


1 Answers

You cant run sshpass in windows. You can however use putty via the windows command line, to achieve the same thing.

putty -load "host" -l username -pw password

Also you can upload files via command line (with a password) using WinSCP

winscp /command "option batch abort" "option confirm off" "open sftp://user:[email protected]/" "put examplefile.txt /home/user/" "exit"
like image 107
Jay Shepherd Avatar answered Sep 16 '22 14:09

Jay Shepherd