In linux, how can I avoid password prompts when using the remote Copy command scp?

Source: Internet
Author: User
In linux, if you use the remote Copy command scp, how can I avoid the password prompt-Linux Enterprise Application-Linux server application information? For details, see the following. Write the ssh public key file of your local host user to the remote host user ~ /. Ssh/authorized_keys file, the specific method
Assume that the local host test1 and remote host test2

1. users in the test1 host
Run ssh-keygen-t rsa
The result is as follows:
Generating public/private rsa key pair.

Enter file in which to save the key (/home/. username/ssh/id_rsa): # Press Enter

Enter passphrase (empty for no passphrase): # Press Enter

Enter same passphrase again: # Press Enter

Your identification has been saved in/home/. username/. ssh/id_rsa.

Your public key has been saved in/home/. username/. ssh/id_rsa.pub.

The key fingerprint is:

38: 25: c1: 4d: 5d: d3: 89: bb: 46: 67: bf: 52: af: c3: 17: 0c username @ localhost

Generating RSA keys:

Key generation complete.
Will be in the user directory ~ /. Ssh/generate two files: id_rsa, id_rsa.pub

2. Copy the id_rsa.pub file to the user directory of the test2 host.
Cat id_rsa.pub> ~ /. Ssh/authorized_keys
You can.

In this way, users of the test1 host can log on to the test2 host through ssh without a password.

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.