Like the Apt-get installer will have the-y parameter to avoid interactive input, I also hope that SSH login can be directly attached to the login password to avoid the interactive input password This step, online search, a lot of methods.
For example, directly through the key password-free login, but need to change a lot, feeling very troublesome. What is more want is not to change the configuration of Server/client Direct-free interactive SSH login.
So I looked at the help first:
There are no parameters available to attach the login password, so continue to find a way.
Sshpass
Sshpass: For non-interactive SSH password authentication
SSH login can not specify the password on the command line, and can not be seen everywhere in the shell, Sshpass, solve the problem. It allows you to specify a clear-text password with the-p parameter and then log in directly to the remote server. It supports the reading of passwords from the command line, files, and environment variables.
Way to find out, and now first installed on their own machine.
For Debian/ubuntu systems, the installation method is simple:
sudo apt-get install Sshpass
For other systems, you can compile the source code:
1 wget http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz 2 tar xvzf sshpass-1.05. tar.gz 34 make5 sudo Make install
You can also download the sshpass-1.05.tar.gz file directly by visiting this.
/configure can add parameters to specify the installation directory, such as:
To install the Sshpass to your preferred location, if this parameter is not installed, install it to the default location.
Once installed, enter Sshpass to see if the installation is ready:
This can be done by:
sshpass-p [passwd] ssh-p [port] [email protected]
To log in to the remote host.
"essay" How to add a login password directly to the parameter when SSH login