You can log into the Linux server console remotely without using a password. To do this, you need to use the SSH authentication method using RSA keys.
This method is more convenient and safer to use.
This article describes the setup procedure if you are connecting from a computer with a Linux (or MacOS).
To configure the authentication method, follow these steps:
- Run the command
ssh-keygen
in the bash console:
As a result, two files will be generated in the ~/.ssh folder
- Private key file - id_rsa
- Public key file - id_rsa.pub
Attention! The private key file must be protected from unauthorized access. Make sure that this file is not compromised.
- To save or update the key fingerprint, run the command
ssh-keyscan x.x.x.x >>~/.ssh/known_hosts
Hereinafter
x.x.x.x
- is the IP address of your server on the hosting
- Run the command
ssh-copy-id@x.x.x.x
and enter the root password you received when you activated the server on the hosting
- If the password you entered is correct, the setup procedure is complete. Further, you can connect to the VPS server on the hosting without entering a password using the command in the console:
To configure SSH connection under Windows OS, see Knowledge Base article