Non-interactive SSH password verification for Linux commands-sshpass

Source: Internet
Author: User
You cannot specify a password in the Command Line for ssh login. The emergence of sshpass solves this problem. Sshpass is used for non-interactive SSH password verification. it is generally used in sh scripts and no need

You cannot specify a password in the Command Line for ssh login. The emergence of sshpass solves this problem. Sshpass is used for non-interactive SSH password verification. it is generally used in sh scripts and does not need to be entered again.

It allows you to use the-p parameter to specify the plaintext password and then directly log on to the remote server. it supports reading the password from command lines, files, and environment variables.

It is not installed by default and must be manually installed as follows:

Sshpass: the http://sourceforge.net/projects/sshpass/ is downloaded as a tar.gz compressed package.

$ Tar zxvf sshpass-1.05.tar.gz

$ Sshpass-1.05 cd

$./Configure -- prefix =/opt/sshpass # specify the installation directory

$ Make

$ Make install

$ Cp/opt/sshpass/bin/sshpass/usr/bin/

After the above steps, the sshpass installation is complete. if you enter the command sshpass, the installation is successful if the following prompt appears:

# Pass the password-p from the command line to specify the password

$ Sshpass-p '000000' ssh user_name @ host_ip

$ Sshpass-p '000000' scp root @ host_ip:/home/test/t./tmp/

Related Article

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.