How to connect securely to your server via SSH.
Requirements
- IP address or hostname of your server
- Username (usually
rooton 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
| Problem | Solution |
|---|---|
Connection refused | Is the SSH service running? Check firewall/port 22. |
Permission denied | Verify username and password or key. |
| Timeout | Correct IP? Server reachable (ping/VNC)? |