How to connect securely to your server via SSH.

Requirements

  • IP address or hostname of your server
  • Username (usually root on Linux)
  • Your password or an SSH key

Connecting with a password

Open a terminal and enter the following command:

ssh root@YOUR-SERVER-IP

On the first connection, confirm the fingerprint with yes. Then enter your password.

More secure: connecting with an SSH key

Generate a key pair locally and copy the public key to the server:

ssh-keygen -t ed25519
ssh-copy-id root@YOUR-SERVER-IP
Tip
After setting up the key you should disable password login – this improves security considerably.

Common issues

ProblemSolution
Connection refusedIs the SSH service running? Check firewall/port 22.
Permission deniedVerify username and password or key.
TimeoutCorrect IP? Server reachable (ping/VNC)?