Automatic password entry using SCP remote transfer under Linux

Source: Internet
Author: User
Tags scp command

Due to the need to remotely transfer the file a server to the B server but the SCP command to manually enter the password each time so that the script execution is too cumbersome, so that a server and B server Trust can be, the specific operation is as follows:

First in a server configuration:                         mkdir-p ~/.ssh                         chmod ~/.ssh then generate the key file in the ~/.SSH directory:                         cd ~/.shh                         ssh-keygen-t rsa-p ""-F ~/.ssh /id_rsa then configure on the B server:                          mkdir-p ~/.ssh                          Touch ~/.ssh/authorized_keys appends the id_rsa.pub content of the a server to the authorized_ of server B Keys inside                          ssh 192.168.1.1 (a server's IP address does not need an add-on port number)                                    cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys    chmod ~/.ssh/authorized_keys last executed scp-r demotest b server IP address:/ Can

Automatic password entry using SCP remote transfer under Linux

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.