Languages
[Edit]
EN

Bash - run command on server over SSH and automatically enter password

6 points
Created by:
Nataniel-Barclay
499

In this short article, we would like to show how to run command on server over SSH and automatically enter password in Bash.

By default ssh command doesn't let to insert a password as a parameter, the solution is to use sshpass or plink command.

Quick solution:

Note: plink is available under Windows and Linux - check the installation section.

 

Practical example

Edit

plink installation

Edit

Under Windows, you can use putty installer (go to MSI (‘Windows Installer’) section).

Under Debian based Linux run:

See also

Edit
  1. Bash - run remote command as super user using ssh connection with plink command

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join