SSH authentication is an encrypted protocol to access remote server. VPS is visible over the Internet,Now a days lot of password based attacks are there. It is better to use Key based authentication.
SSH key pairs are two crypto-secure keys that can be used to authenticate a client to an SSH server. Each key pair consists of a private key and public key
The private key is holded by the client and should be kept absolutely secret.The corresponding public key can be shared freely without any negative consequences. The public key can be used to encrypt messages that only decrypt by private key. This is the way of passwordless authentication using the key pair.
Private Key is used for accessing the server from remote computer.
Public Key is used to allow remote connection on the local server
Place the public key on the server that you want to access, in file /root/.ssh/authorized_keys .
If you want to access this server with the ssh key than copy Public key to /root/.ssh/authorized_keys
and copy Private key to your computer which you will use for accessing this server, Private Key location /root/.ssh/id_rsa .
If you want to access multiple servers with one key than copy the same Public Key to all servers.
login to CWP as root
Server Settings --> SSH Key Generator
We can Generate New SSH Private and Public Key, It will overwrite old files if they exist