Linux Remote logon using public key and public remote Logon

Source: Internet
Author: User

Linux Remote logon using public key and public remote Logon


I. Preface:

There are three methods for ssh remote logon password Authentication: password Authentication, Keyboard Interactive, and Public Key. The third is the most secure login method. Next we will implement the third public key authentication method. Ii. Principle: The ssh client uses the private key sent from the server to perform logon authentication and authenticate the public key of the server. Secure Access. 3. Preparation: Server System: Centos7.1 4. Server generates the ssh key-keygen-B 1024-t dsa and then directly enters the generated path:/root /. ssh/-rw-r --. 1 root 668 Aug 1 id_dsa-rw-r -- r --. 1 root 616 Aug 1 id_dsa.pub modify permission: chmod 700. ssh/chmod 600 ~ /. Ssh/id_dsachmod 644 ~ /. Ssh/id_dsa.pub to generate the authentication key: cat id_dsa.pub> authorized_keys-rw-r -- r --. 1 root 616 Aug 1 authorized_keys-rw-r -- r --. 1 root 668 Aug 1 id_dsa-rw-r -- r --. 1 root 616 Aug 1 05:05 id_dsa.pub 5. Change the sshd configuration file vi/etc/ssh/sshd_configRSAAuthentication yesPubkeyAuthentication yesAuthorizedKeysFile. ssh/authorized_keys # enable authentication and set the authentication path PasswordAuthentication no # Disable password authentication and save. 6. Send the Private Key to the client and restart the sshd service syst. Emctl restart sshd 7. Use xshell to remotely log on to the ssh address ---> enter the user name ---> select public key to import the certificate ---> to log on! Select Browse File and select private key !! Login successful !!

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.