If you are a Linux operation, then the Linux Server system security issues, you may want to consider, and the system login method has two kinds, passwords and keys. Which one is more secure? Undoubtedly the latter! Here I share with you the way to log in to a Linux server using a key Xshell!
About Xshell, it is a powerful secure terminal emulation software that supports SSH1, SSH2, and the Telnet protocol of the Microsoft Windows platform. Similar tools are putty, SECURECRT and so on.
1, click the Xshell menu Bar tool, select the new User Key Generation Wizard, the key pair build operation.
2.
At this time, you have a pair of keys, you need to start setting up the configuration of the server, enable key authentication login, and for the sake of system security, the way to turn off password Authentication!
Vim/etc/ssh/sshd_config
Modify the following places:
Pubkeyauthentication Yes #启用PublicKey认证.
Authorizedkeysfile. Ssh/authorized_keys #PublicKey文件路径.
Passwordauthentication no #不适用密码认证登录.
3.
4.
Next, in the. SSH directory of the user's home directory where you need to log in, edit the Authorized_keys file to begin writing the public key of our generated key pair to this file.
Public key Viewing method: Click the Xshell Menu tool, select the user Key Manager, double-click the key you just generated open properties, select the public key, copy the contents of the public key, later use!
5. If you want to log in to the user's home directory without the. SSH directory, you can create a directory automatically by using the Ssh-keygen command to generate the server's own key mode.
6, then, modify the permissions of the file, or you may encounter problems!
7.
Now, login to test it! You will find that the password column is grayed out after entering the user!
Login successful, Configuration complete!
Log in to the Linux system using the Xshell tool key authentication