Use SSH login VPS generally use the ip+ port, enter username and password to log in
In order to enhance the security of the VPS, use the public key and the private key way to login VPS
The specific methods are:
Generate key on Linux remote server:ssh-keygen-t RSA
And then you can get a carriage.
Generating public/private RSA key pair.
Enter file in which to save the key (/ROOT/.SSH/ID_RSA)://Direct return
Created directory '/root/.ssh '.
Enter passphrase (empty for no passphrase)://Enter key password
Enter same Passphrase again://Repeat Key password
Your identification has been saved In/root/.ssh/id_rsa. Tip the public and private keys are already stored in the/root/.ssh/directory
Your public key has been saved in/root/.ssh/id_rsa.pub.
15:23:A1:41:90:10:05:29:4C:D6:C0:11:61:13:23:DD root@localhost
The key ' s Randomart image is:
The generated private key Id_rsa is then downloaded. The Putty private key PPK file is then generated locally with the Puttygen tool
At the same time, the Id_rsa.pub file generated on the VPS is renamed Authorized_keys
You can execute the following command:
Mv/root/.ssh/id_rsa.pub/root/.ssh/authorized_keys
Then the permission to modify this file is 600
chmod 600/root/.ssh/authorized_keys
This completes the VPS on the generation of public key.
You will then need to configure SSH for the associated
Modify the/etc/ssh/sshd_config file to change the values after Rsaauthentication and pubkeyauthentication to Yes and save them.
Restart the sshd service and perform/etc/init.d/ssh restart.
Here is the action to generate PPK as shown
Select conversion
Select Import Key, which is the Id_rsa file generated from the VPS
Enter the password you just set
Then select Save As Private key key
Open Putty Enter the IP port number and select the SSH option on the left
Select Auth and then select the PPK private key file that you just generated
Click Browser to select the generated PPK file on your computer
The last thing you need to do is to log in with the password and log on with the key.
1. Modify/etc/ssh/sshd_config File
Modify Passwordauthentication Yes to Passwordauthentication no
2, restart sshd service/etc/init.d/ssh restart