Difference between revisions of "Sshpass"

From Notes_Wiki
(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 ...")
 
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
=sshpass=
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[System administration tools]] > [[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 supply SSH password in command, through file, or through environment variable etc.  
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 supply SSH password in command, through file, or through environment variable etc.  
Line 8: Line 8:
</pre>
</pre>


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 [[expect]]. But learning [[expect]] would allow one to deal with more complex / variety of situations then just SSH.
 
 
 
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[System administration tools]] > [[sshpass]]

Latest revision as of 12:12, 28 July 2022

Home > CentOS > CentOS 6.x > System administration tools > 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.


Home > CentOS > CentOS 6.x > System administration tools > sshpass