In this short article, we would like to show how to run command on server over SSH and automatically enter password in Bash.
ssh command doesn't let to insert a password as a parameter, the solution is to use
plink -pw user_password user@$my-domain.com "command_to_run -arg1 -arg2 -argN"
plinkis available under Windows and Linux - check the installation section.
plink -pw my_secret_password john@$my-domain.com "cd / && ls -al"
Under Windows, you can use putty installer (go to MSI (‘Windows Installer’) section).
Under Debian based Linux run:
sudo apt-get update sudo apt-get install plink