Has not understood the authentication process in the public key mode, here summarizes the method of making and placing the public key and the private key. The following uses VM VMS and WIN10 as the environment. First, the public key and the private key are not generated on the server. Because many articles about RSA and DSA authentication protocols use Linux servers as props, and naturally use commands such as ssh-keygen-t RSA, which makes me always mistakenly think that I have to first make a public key and a private key on a Linux server. And the real way is: When you connect to the server from the PC, you need to save a pair of keys and keys on your PC (this pair of keys and private keys can be generated using tools such as Xshell or putty), and simply upload the generated public key to the server. And often on the server, the public key is placed in the ~/.ssh/authorized_keys file. Take Xshell as an example, really do not want to use putty, but met putty with very good people. I also admire from the heart. Well, there's not much to say here, let's start.
1, open xshell interface, Chinese interface convenient operation, menu bar: Tools -- New user key Generation Wizard
2. Click Generate
3. Key type selection RSA , key length selection 2048 bit, click Next to continue
4. Define Key's name and password, which can be used or not
5. View Public Key
6 , copy the generated public key to the remote Linux inside /root/.ssh/authorized_keys file, you can manually create a
Then click Login in Xhsell
Xshell Creating an RSA login Linux host