Troubleshooting SSH connection issues on Elastic Metal servers
Problem
You are unable to connect to your Scaleway Elastic Metal server via SSH.
Symptoms
- SSH connection times out or is refused.
- You receive an authentication failure when entering credentials.
- You see a "Permission denied" error when using an SSH key.
- SSH hangs indefinitely without a response.
- The server is unreachable via its public IP.
Possible causes
- The SSH service is not running or is misconfigured.
- The server is not accessible due to firewall or network restrictions.
- Incorrect SSH credentials or key configuration.
- The server is in rescue mode and requires a different login method.
- A recent security policy change has disabled SSH access.
- You recently changed your SSH keys, and they have not been added to the Elastic Metal server.
Solution
Check network connectivity
- Try pinging the server: ping <server-ip>.
- Use traceroute <server-ip>to diagnose potential routing issues.
- If using a Private Network, verify that you are connecting from the correct subnet.
Check SSH key and credentials
- Ensure you are using the correct SSH key associated with your Scaleway account.
- Run SSH with verbose mode (ssh -v root@<server-ip>) to diagnose authentication errors.
- If logging in with a password, check that password authentication is enabled in /etc/ssh/sshd_config.
Check firewall and security settings
- List firewall rules using iptables -L -v -norufw status.
- If necessary, temporarily disable the firewall using systemctl stop firewalldorufw disable.
- Ensure SSH is allowed on port 22 (or your custom SSH port if changed).
Ensure the server is in normal mode
- If the server is in rescue mode, reboot it into normal mode.
- Rescue mode may require different credentials (visible in your Scaleway console) to log in.
Verify the SSH service status
- Use the remote console from the Scaleway dashboard to access your server.
- Run systemctl status sshto check if the SSH service is running.
- If the service is stopped, restart it using systemctl restart ssh.
Add the new SSH key to the existent system
- Reboot in rescue mode as explained in this documentation
- Mount filesystem in rescue mode to access data and files by folowing these steps
- Modify the "authorized_keys" file to add your new SSH public key at the end
Still need help?Create a support ticket