Encryption-free login does not mean that you can log in to a remote host without a password. It is a security authentication implemented by encrypting the public key and decrypting the private key. First, you need to pass it on a Windows hostssh-keygen
To generate a public and private key pair, perform the following steps:The -t parameter specifies the encryption algorithm, and the -b parameter specifies the number of bits of the key pair.
Enter file in which to save the key (C:\Users\ XXX /.ssh/id_rsa): allows you to Enter the location where the key is saved. Default is the location in the parentheses.
Enter passphrase (empty for no passphrase): it asks you to Enter your password for authentication. If this is set, it will ask you to Enter this password for authentication every time you connect. This is not what we want, so just press Enter and set it to empty.
The inputcd .ssh
Command to go to the current user’s home directory.ssh
Hide the folder and you can see the two keys you just generated, whereid_rsa
Is the private key,id_rsa.pub
Is a public key, as shown in the figure:Connect to the Linux remote host and create it in the root directory.ssh
Folder, and in.ssh
Folder created under the nameauthorized_keys
And copy the public key to the file, save and exit, as shown in the figure:At this point, it is complete, the next time the user can directly log in to the remote host without secret.