Troubleshooting SSH on Linodes

This guide presents troubleshooting strategies for when you can't connect to your Linode via SSH. If you currently cannot ping your Linode, then your server also likely has more basic connection issues. If this is the case, you should instead follow the Troubleshooting basic connection issues guide. If you restore basic networking to your Linode but still can't access SSH, return to this guide.

If you can access SSH but not other services, refer to the Troubleshooting web servers, databases, and other services guide.

📘

Additional resources for help

This guide explains how to use different troubleshooting commands on your Linode. These commands can produce diagnostic information and logs that may expose the root of your connection issues. For some specific examples of diagnostic information, this guide also explains the corresponding cause of the issue and presents solutions for it.

If the information and logs you gather do not match a solution outlined here, consider searching the Community Site for posts that match your system's symptoms. Or, post a new question in the Community Site and include your commands' output.

We are not responsible for the configuration or installation of software on your Linode. Refer to Scope of Support for a description of which issues Support can help with.

Before you begin

Before troubleshooting your SSH service, familiarize yourself with the Linode Shell.

The Linode shell (Lish)

Lish is a shell that provides access to your Linode's serial console. Lish does not establish a network connection to your Linode, so you can use it when your networking is down or SSH is inaccessible. While troubleshooting SSH, all commands you enter on your system will be performed from the Lish console.

To learn about Lish in more detail, and for instructions on how to connect to your Linode via Lish, review the Access your system console using Lish > Through SSH guide. In particular, Cloud Manager is a fast and simple way to access Lish.

Forgotten your password?

If you have forgotten your Linux user's password, you will not be able to log in with Lish. You can reset the root password for your Linode with these instructions. If you are logged in as root, you can change the password of another user with the passwd command:

passwd <username>

If you reset your password and can log in with Lish, try logging in with SSH, as that may have been the cause of your connection problems.

Troubleshoot unresponsive SSH connections

If your SSH connection attempts are timing out or are being immediately rejected, then your SSH daemon may not be running, or your firewall may be blocking SSH connections. This section will help troubleshoot these issues.

If your connections are not timing out or being rejected, or if you are able to resolve these issues but you still can't access SSH because of rejected login attempts, then continue to the Troubleshoot rejected SSH logins section.

Is SSH running?

  1. To check on the status of your SSH daemon, run:

    DistributionCommand
    systemd systems (Arch, Ubuntu 16.04+, Debian 8+, CentOS 7+, etc)sudo systemctl status sshd -l
    CentOS 6sudo service sshd status
    Ubuntu 14.04, Debian 7sudo service ssh status
  2. If the command reports the service is running, review the Is SSH running on a non-standard port? section.

  3. If the command reports the service is not running, then try restarting it:

    DistributionCommand
    systemd systemssudo systemctl restart sshd
    CentOS 6sudo service sshd restart
    Ubuntu 14.04, Debian 7sudo service ssh restart