First you need to install sshpass.
- Ubuntu/Debian:
apt-get install sshpass
- Fedora/CentOS:
yum install sshpass
- Arch:
pacman -S sshpass
Example:
sshpass -p "YOUR_PASSWORD" ssh -o StrictHostKeyChecking=no YOUR_USERNAME@SOME_SITE.COM
Custom port example:
sshpass -p "YOUR_PASSWORD" ssh -o StrictHostKeyChecking=no YOUR_USERNAME@SOME_SITE.COM:2400
from : https://stackoverflow.com/questions/12202587/automatically-enter-ssh-password-with-script
This works better for me though for sshfs:
echo $mypassword | sshfs -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no user@host mountpoint -o workaround=rename -o password_stdin
nJoy 😉