

With no parameters - password will be taken from stdinĪt most one of -f, -d, -p or -e should be usedĪs I mentioned before, sshpass is more reliable and useful for scripting purposes, consider the example commands below. e Password is passed as env-var "SSHPASS"

p password Provide password as argument (security unwise) d number Use number as file descriptor for getting password f filename Take password to use from file

Sshpass Help Usage: sshpass command parameters I highly recommend using SSH Passwordless authentication. Important: Using sshpass considered to be least secure, as it reveals the password to all system users on the command line with simple “ps” command. Sshpass runs ssh in a devoted tty, mislead it into believing that it is receiving the password from an interactive user. Ssh uses straight TTY access to make sure that the password is actually supplied by an interactive keyboard user. Sshpass is a simple and lightweight command line tool that enables us to provide password (non-interactive password authentication) to the command prompt itself, so that automated shell scripts can be executed to take backups via cron scheduler. What if you want to supply a password along with username to SSH prompt itself? this is where sshpass comes to rescue. In most cases, Linux system administrators login to remote Linux servers using SSH either by supplying a password, or passwordless SSH login, or keybased SSH authentication.
