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 !!