Windows generate SSH public key and connect to the server through SSH key tutorial

888u

Last update at :2024-03-17,Edit by888u

This site has previously shared "Linux VPS generates SSH public key and configures SSH public key for password-free login". Many friends are using Windows computers and want to ask how to generate SSH public key on Windows and then use SSH. key to connect to the host to ensure the security of SSH. Today I will introduce the specific configuration tutorial.

1. Download key generation software

Linux generally comes with OpenSSH, so we can directly generate keys through the ssh-keygen command. If you want to generate keys on Windows, you need to use software. For example, the PuTTY introduced earlier can generate keys. Tools for pairing (public and private keys).

Download address: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

The software you need to use this time is PuTTYgen, just download the corresponding version directly.

2. Windows generates key pair

Run puttygen.exe, select SSH-2 (RSA) type key, select 4096 as the key length, and click Generate to create the key:

During the key generation process, we can control the mouse to move in the blank space of the software to ensure the randomness of the data:

Finally, the key pair is successfully created on Windows. We can set the key protection password (generally not needed), and then save the public key file and private key file:

3. Connect to the host through SSH key

After generating the SSH public key on Windows, how to configure the SSH public key for password-free login is the same as on Linux. Directly copy the Windows SSH public key file to the VPS that needs to be remote, and then go to the /root of the target VPS. In the /.ssh folder, write the local public key file just now into authorized_keys:

cat id_rsa.pub >> authorized_keys

You can log in directly with the software through the key file, such as PuTTY configuration key:

Recommended site searches: http proxy ip, ip reverse domain name query, forum registration, my ip address, Guangzhou server hosting, wordpress space, server proxy ip, registered domain name query, Hong Kong vps host, free server,

Windows generate SSH public key and connect to the server through SSH key tutorial

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码