Bootstrap FreeKB - SSH - Connect to an SSH server without a password using the sshpass command
SSH - Connect to an SSH server without a password using the sshpass command

Updated:   |  SSH articles

The sshpass command can be used to provide your SSH password on the command line to aviod the prompt for your SSH password. dnf or yum can be used to install sshpass on a Red Hat distribution (CentOS, Fedora, Red Hat).

dnf install sshpass

 

And here is how you would make an SSH connection using sshpass.

sshpass -p 'itsasecret' ssh john.doe@server1.example.com

 

Or the -f option can be used to read the password from a file.

sshpass -f pw.txt ssh john.doe@server1.example.com

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 5a946b in the box below so that we can be sure you are a human.