Install OpenSSh. Generally, the linux system has [root @ sqzr ~] The ssh-keygen-b1024-trsaGeneratingpublicprivatersakeypair prompts that an rsa key pair is being generated for Enterfileinwhichtosavethekey (ro
- Install OpenSSh.
[Root @ sqzr ~] # Ssh-keygen-B 1024-t rsa
Generating public/private rsa key pair. # the system prompts that an rsa key pair is being generated.
Enter file in which to save the key (/root/. ssh/id_dsa)
Enter passphrase (empty for no passphrase): # Enter the private key secret and Enter the secret
Enter same passphrase again: # prompt again for entering the password for confirmation
Your identification has been saved in/root/. ssh/id_dsa. # the system prompts that the public key and private key are already stored in the/root/. ssh/directory.
Your public key has been saved in/root/. ssh/id_dsa.pub.
The key fingerprint is:
X6: 68: xx: 93: 98: 8x: 87: 95: 7x: 2x: 4x: x9: 81: xx: 56: 94 root @ server # key fingerprint prompt
- After the file is generated, save the/root/. ssh/id_dsa file to the local device through WinSCP.
- Download puttygen.exe (see the end of the article), save it to the local id_dsa import, and enter the private key secret language entered during generation.
- After the import is successful, save the public key and write the content of the public key ~ /. Ssh/authorized_keys
- Save the private key with the suffix ppk and disable linux password logon (only private key logon is allowed)
Modify the/etc/ssh/sshd_config file
Change PasswordAuthentication yes to PasswordAuthentication no, and restart ssh
Import private keys in putty
If you do not need to use a private key to log on again, you can enter the password of the private key, even if the private key file is obtained by someone else, no one else can know which server the private key file belongs to or get the private key password.
Tools:
Puttygen Official Download link: http://the.earth.li /~ Sgtatham/putty/latest/x86/puttygen.exe
Putty Official Download link: http://the.earth.li /~ Sgtatham/putty/latest/x86/putty.exe