How to automatically enter the password when executing scp in the script
Source: Internet
Author: User
When executing scp in a script, you can automatically enter the password in Perl or other scripts, and the script will be interrupted. How can I avoid being interrupted? SCP can automatically enter the password and the script runs smoothly? I used an sshpass tool. 1: h. when executing scp in a script, the script will be interrupted because the password is automatically entered in Perl or other scripts. How can I avoid being interrupted? SCP can automatically enter the password and the script runs smoothly? I used an sshpass tool. 1.: http://sourceforge.net/projects/sshpass/ 2. install :. /configure make install 3. in order to execute the command cp sshpass/user/bin/4 anywhere. run the following command: sshpass-p $ PASSWD scp-o StrictHostKeyChecking = no $ CMD 'CD $ path & sshpass-p HS ~ U8ro8e scp-o StrictHostKeyChecking = no $ package javadev \ @ 121.199.60.78:/home/javadev/server ';
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