Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to issue password in ssh command

📅 2013-Aug-14 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ ssh, ubuntu ⬩ 📚 Archive

The ssh command can be passed the name of the host computer and your login on it. After this it asks for the password. However, you may sometimes want to issue the password along with the ssh command.

One possible solution for this is to use the sshpass tool. The tool can be installed easily from the Ubuntu repositories:

$ sudo apt-get install sshpass

To issue your password along with your ssh command, use this:

$ sshpass -p "mypassword" ssh mylogin@myhost

Tried with: sshpass 1.05 and Ubuntu 12.04 LTS

© 2023 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 Mastodon📧 Email