SSH Public private key Connect remote server

Source: Internet
Author: User

Because it is safe to not let the online server be scanned out of the listening port, it is recommended to use the public key to connect the server on the Internet, to make our server more secure, the following steps:

    1. Use SECURECRT to create the public key, which is the client's private key, such as:

      650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/75/04/wKiom1Ywilqz6zzAAAM9vF1TSLs957.jpg "title=" Create a public key. png "alt=" wkiom1ywilqz6zzaaam9vf1tsls957.jpg "/>

      Click Create Identity file, as

      650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/75/04/wKiom1Ywiq7RWwiJAAP0xj-RMDc952.jpg "title=" Key generation. png "alt=" wkiom1ywiq7rwwijaap0xj-rmdc952.jpg "/>


Click Next, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/75/02/wKioL1YwjPeCRtmfAAEAv0caOr8485.jpg "title=" create. png "alt=" Wkiol1ywjpecrtmfaaeav0caor8485.jpg "/>

Click Next, such as:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/75/04/wKiom1Ywiu7gU7iRAAEc69aFVeM209.jpg "title=" Select Rsa.png "alt=" Wkiom1ywiu7gu7iraaec69afvem209.jpg "/>

Select RSA and click Next, such as:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/75/02/wKioL1YwjZfgo0_hAAF9g9MIsJI677.jpg "title=" Custom phrase. png "alt=" wkiol1ywjzfgo0_haaf9g9misji677.jpg "/>

Custom phrases, which will be used when logging in, click Next, such as:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/75/01/wKioL1Ywi1iRFvWdAAFIfnyYH4M138.jpg "title=" Key length. png "alt=" wkiol1ywi1irfvwdaafifnyyh4m138.jpg "/>

Custom password length, of course the longer the more secure, here Select the 1024, click Next, such as:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/75/02/wKioL1Ywjf_wzu0VAAGFDLvT4Ck652.jpg "title=" Key storage directory. png "alt=" wkiol1ywjf_wzu0vaagfdlvt4ck652.jpg "/>

Select the key store directory and click "Finish", such as:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/75/02/wKioL1YwjmGAxBOBAACQSvEUpII581.jpg "title=" is. png " alt= "Wkiol1ywjmgaxbobaacqsveupii581.jpg"/>

Select "Yes"

2. Locate the private key file in the D:\Documents\Identity directory: Identity.pub upload it to the remote server, which is located in the/root/.ssh directory of the server on the Internet, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/75/02/wKioL1Ywj9bjz_xwAAExKWentiA779.jpg "title=" id- Pub.png "alt=" Wkiol1ywj9bjz_xwaaexkwentia779.jpg "/>

Then the key file is the client private key identity.pub content appended to the Authorized_keys file, such as the following command:

[Email protected] ~]# ssh-keyen-i-F identity.pub >> Authorized_keys

Restart the sshd service, such as the following command:

[email protected]. ssh]# Service sshd Restart


3. Modify the CRT client, such as:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/75/05/wKiom1YwkTfSBzRzAAHvzKxjqVI408.jpg "title=" Connection modified. png "alt=" wkiom1ywktfsbzrzaahvzkxjqvi408.jpg "/>

Select "Use Session public key Settings" and click OK to connect, such as:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/75/05/wKiom1YwkiPAsoJBAADKG9YXrn4431.jpg "title=" Direct Connect. png "alt=" wkiom1ywkipasojbaadkg9yxrn4431.jpg "/>

Click "Connect" to complete the configuration



This article is from the "Lucky Dog" blog, make sure to keep this source http://703356.blog.51cto.com/693356/1707367

SSH Public private key Connect remote server

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.