Difference between revisions of "Sshpass"

From Notes_Wiki
m
m
Line 1: Line 1:
<yambe:breadcrumb>System administration tools</yambe:breadcrumb>
<yambe:breadcrumb self="Sshpass">System administration tools|System administration tools</yambe:breadcrumb>
=sshpass=
=sshpass=


Line 10: Line 10:


This is much simpler than trying to learn and use '<tt>expect</tt>'. But learning <tt>expect</tt> would allow one to deal with more complex / variety of situations then just SSH.
This is much simpler than trying to learn and use '<tt>expect</tt>'. But learning <tt>expect</tt> would allow one to deal with more complex / variety of situations then just SSH.
<yambe:breadcrumb self="Sshpass">System administration tools|System administration tools</yambe:breadcrumb>

Revision as of 09:14, 27 August 2018

<yambe:breadcrumb self="Sshpass">System administration tools|System administration tools</yambe:breadcrumb>

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.



<yambe:breadcrumb self="Sshpass">System administration tools|System administration tools</yambe:breadcrumb>