Sshpass

From Notes_Wiki
Revision as of 04:36, 13 November 2012 by Saurabh (talk | contribs) (Created page with "=sshpass= To supply SSH password programatically one can use '<tt>sshpass</tt>' program. Its source code can be downloaded from source forge. Using sshpass it is possible to ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

sshpass

To supply SSH password programatically one can use 'sshpass' program. Its source code can be downloaded from source forge. Using sshpass it is possible to supply SSH password in command, through file, or through environment variable etc.

Example command that takes password from command line parameters

sshpass -p '<server_password>' ssh <username>@<server> <ssh_options>

This is much simpler than trying to learn and use 'expect'. But learning expect would allow one to deal with more complex / variety of situations then just SSH.