Instructions for using Pair key to connect ssh

Pair key is formed from public key and private key

The public key is placed in the server so that when the client connects, there must be a new private key server for the connection. This process helps to secure the server if unfortunately the ip is exposed and the password is detected.

Step 1: Use putty to run ssh key pair, select RSA 2048, click Generate to start generating keys

Step 2: Save the public key in turn by clicking the save public key button

Step 3: Save the private key by clicking the save private key button

Step 4: Then open it up and copy the key off


Step 5: Go to the server to create the .ssh file with the command

mkdir .ssh

Step 6: Create and edit the authorized_keys file using the touch . command

touch authorized_keys

Step 7: Go to the authorized_keys file using the command

vi authorized_keys

Step 8: Then paste the key pair

Step 9: Next, reset the ssh file with the command

vi / etc / ssh / sshd_config

Step 10: Edit the config file to

PermitRootLogin prohibit-password

PasswordAuthentication no

Step 11: Restart the service to update the config file using the command

systemctl restart sshd.service

Step 12: Go to putty, go to Connection>SSH>Auth then click Browse to select the saved ssh key

Step 13: login to the server using ssh

Step 14: Try to log in with another machine and immediately report an error


We have just completed the basic steps to install Pair key on ssh, here we can remote ssh securely with Pair key.

Thank you for reading.

Bé Snake