Troubleshoot cloud instance connection

You may encounter issues when attempting to connect to your instance. The guides below will help you troubleshoot connecting to a Linux instance, created from one of our public images

If you are having trouble establishing the first connection you should start by re-checking that you correctly followed the initial steps to connect

If this is unsuccessful, or an existing instance is now unreachable, you can read through the sections below to troubleshoot your connection issues.

Note: If you have used another operating system (like Windows) from a custom boot source, then the process of connecting to your instance will likely differ. Our help guides and customer support is limited, and you will need to manage connecting and troubleshooting yourself.


  • Common connection errors

    Below is the list of common errors you may encounter, and suggested actions you can follow. The sections below explain the troubleshooting steps.

    Error Message Suggested Action
    Connection timed out Check security group rules
    Connection refused Check the SSH command
    Please log in as the user “X” rather than the user “Y”. Check the instance username
    Network is unreachable Check the instance IP address
    Host key verification failed Check the private key is correct
    Unable to load key Check the private key format
    User key not recognized by server Check the private key is correct and format
    Permission denied / too open / (public key) Check the instance username

    Check the private key is correct, format and permissions

    Connection closed by [instance] port 22 Check the instance username

    Check the private key is correct, format and permissions

    Unprotected private key file / permissions too open Check the private key permissions
    Private key must begin with… Check the private key format
    Server refused our key Check the instance username

    Check the private key format

    No supported authentication methods available Check the instance username

    Check the private key format





  • Check the status/power state

    The instance must be in an Active status, and a Running power state in order to connect.

    Rebooting the instance can help if there is a general issue.

    Steps

    1. 1
      Using the menu on the left, navigate to Compute > Instances.
    2. 2
      In the Instance table, find the instance you want to view.
    3. 3
      The current Power State and Status will be displayed.





  • Check the instance console log

    The instance console log is a helpful troubleshooting tool to review events errors and diagnose problems. 

    The log contains the text output from the instance console, including the history. Error messages such as failing to find a disk, file system errors, or syntax errors in config files will also display here. 

    By default, the last 35 lines of the console’s output will be displayed. However, you may need to view the full log to find the error.

    Look for ‘eth’, ‘ens’, or ‘cloud-init’ occurrences. Certain issues could involve the inability to detect a network device or, in cases where a snapshot was used, the network not being reconfigured appropriately.





  • Consider recent updates

    If you have lost connection to an instance you should consider recent updates or changes that may be interfering.

    This could include:

    • Changing security group rules or introducing additional firewalls
    • Substantial system upgrades (that might impact kernels or network setups) 
    • Modifications to configuration files (that could hinder the boot process where a program fails to initiate)





  • Check security group rules

    There could be an incorrect configuration in your security group rules. 

    You should check the rules on your assigned security groups to validate:

    • Port 22 has been added as an ingress rule. This will allow incoming SSH traffic.
    • The rule is not set to a specific IP address or IP range. A connection error can occur if you try to connect from an IP that is not allowed. 

    If your security group is properly configured there could be a corporate firewall or a personal firewall that is blocking the connection.





  • Check the SSH command

    There could be an error in the SSH command line you have entered. Double-check that your syntax is correct.

    The file path in the command must be correct. 

    • This should be the fully-qualified path to the location on your computer.
    • The file type (default .pem) must be included.

    Note: On Windows you can drag and drop the file in your terminal which default to the correct path.

    You should also check that you have specified the port in the SSH command (including -p22 at the end).

    For example:

    ssh -i /path/privatekeyname.pem username@ip-address -p22





  • Check the instance username

    A connection error can occur if you use the incorrect username to connect to the instance.

    If this is the first time you are connecting to an instance you must log in with the default username of the instance. You cannot connect using the root username of your local computer.

    If there are users configured on the instance, you can log in with valid user credentials.





  • Check the instance IP address

    A connection error can occur if the IP address is incorrect. You should check that the IP address is correct.

    If you have used the IPv6 address and cannot connect, you can try to use the IPv4 address instead. Some Internet Services Providers (ISPs) are not IPv6 enabled, and cannot route this traffic.





  • Check the private key is correct

    The private key must be the correct matching key for the public key. You may have selected the wrong private key file for the instance. 

    The key pair in use on the instance (the host key) may also have changed or be in error.

    SSH stores the host keys of remote hosts in ~/.ssh/known_hosts. You can remove the ‘offending’ key from this file, and try to connect again.

    The error message you received should display the line number corresponding to the host instance (IP address will be displayed). You will need to remove this line from the known-hosts text file.

    You can either remove this from the file manually, or via command line. In this example, the offending line is line 76.

    sed -i '76d' ~/.ssh/known_hosts

    Once this is deleted, you can attempt to connect again.





  • Check the private key format

    The private key must also be in the correct format

    • The standard format for storing SSH keys is the .pem file type.
    • You can use a text editor to verify that the file is in .pem format. The file should start with the following line:

    -----BEGIN RSA PRIVATE KEY-----
    • If the file does not start with this line, then it is not in PEM format and they will need to convert it to PEM format.

    If you are using the PuTTY client on Windows, this requires the .ppk file type.




Assist Note

You can contact support for assistance with connecting to your instance if our troubleshooting guides do not help resolve your issue.

Please note that our scope of support is limited as xneelo Cloud is a self-managed product. You can read more on the support in xneelo Cloud.