Use SSH-copy-ID to establish trust with the server

Source: Internet
Author: User

Previously, I used to connect to the server using a terminal provided by Mac. The general steps are as follows:

1. Ssh-P 10000 huangwei@1.1.1.1

2. Enter the password

 

However, it is quite troublesome to enter a password every time. The SSH-copy-ID tool is more convenient to log on.

First, generate the public key and private key.

Ssh-keygen-T RSA

After entering the information as prompted ~ /. Generate the id_rsa and id_rsa.pub files under the SSH directory.

 

Then, start to Establish a trust relationship with the server:

Ssh-copy-ID-P 10000 huangwei@1.1.1.1

 

The SSH-copy-id command cannot be used to set the service port with-P. By default, it only connects to port 22.

But you can do it with the following method:

Ssh-copy-ID "-P 10000 huangwei@1.1.1.1"

Enter the password again, and you will not need to enter the password again later.

 

Finally, you can use alias to rename this sentence for convenience.

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.