How to add a login password directly to a parameter in an "essay" SSH login

Source: Internet
Author: User
Tags gz file

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.