Troubleshooting the SSH Connection (2024)

If you're unable to connect to a compute instance using SSH, follow these troubleshooting steps to identify common problems.

Verify the connection

Linux or MacOS

In a terminal window, run the following command:

nc <public ip> 22

Windows

In a PowerShell window, run the following command:

tnc <public ip> -p 22
  • If the command returns a message similar to:

    ComputerName : <public ip>RemoteAddress : <public ip>RemotePort : 22InterfaceAlias : EthernetSourceAddress : <source ip>TcpTestSucceeded : True

    You successfully connected to the instance and verified SSH is running. Double check the IP address in your SSH command, make sure it is correct.

  • If the command returns:WARNING: TCP connect to (<public ip>) failed
    • Check the public IP address on your instance detail page to make sure you are using the correct address.
    • Double check the IP address used in your command, make sure it is correct.

    Otherwise, continue with the troubleshooting suggestions on this page.

Add a public IP address

If the connection is routed over the internet then the instance must have a public IP address to connect to the instance. Without a public IP address, the instance is not reachable.

If you created an instance on a public subnet, but didn't assign a public IP address at instance creation, you can still assign the address, see: Assigning an Ephemeral Public IP to an Existing Primary Private IP.

If you didn't create a public subnet, consider using Virtual Networking Quickstart to create a public subnet for any internet connected instances you want to SSH to.

Instance is on a private subnet

If the instance is on a private subnet, you can use a Bastion to connect to your instance. Review the bastion documentation to ensure your private network is configured to meet Bastion requirements.

Verify the network security lists

Oracle Cloud Infrastructure provisions each cloud network with a default set of security lists to permit SSH traffic. If the security list that permits SSH connections is removed, you can't access the instance. Ensure a security list that opens port 22 is present. For more information about security lists, see Security Lists.

Confirm that the instance is accessible

Check the instance accessibility status metric to determine whether the instance is responding to an Address Resolution Protocol (ARP) request. If the ARP ping fails, the metric shows that the instance is unresponsive. If there isn't an ongoing infrastructure issue, then the instance probably has a software issue or a network misconfiguration that you must resolve yourself.

Connect to the serial console

Serial console connections let you remotely troubleshoot malfunctioning instances. For more information, see Troubleshooting Instances Using Instance Console Connections.

From the serial console, you can interrupt the boot process to boot into maintenance mode. In maintenance mode, you can add or reset the SSH key for the opc user.

Confirm that SSH is running on the instance

The steps for confirming that SSH is running vary depending on the operating system. Review the documentation for your operating system to find information that explains how to confirm whether SSH is running.

Capture serial console history

You can capture the instance's serial console data history in the Console or by using the console-history resource in the CLI. This information can help determine the cause of connectivity problems.

When using the CLI to capture the instance's serial console data history, include the following option to ensure that full history is captured. Without this option, the data might be truncated: --length 10000000.

Update PuTTY tool

If you are trying to connect to a Linux instance from a Windows system using PuTTY and you receive a failure message stating that the key format is too new, then the PuTTYgen tool and the PuTTY tool are not the same version. Update the PuTTY tool to the latest version.

Troubleshooting the SSH Connection (2024)

FAQs

How do you troubleshoot SSH connection issues? ›

Here are some steps you can take to troubleshoot this error.
  1. Verify that the host IP address is correct for the Droplet.
  2. Verify that your network supports connectivity over the SSH port being used. Some public networks may block port 22 or custom SSH ports. ...
  3. Verify the Droplet firewall rules.
Mar 13, 2024

Why is my SSH connection failing? ›

Some common occurrences of the “Connection Refused” error include the absence of an SSH client, lack of an SSH daemon on the remote server, firewall blocking the SSH port, incorrect SSH credentials or port configuration, and the SSH service being down.

How to test an SSH connection? ›

To Test the SSH Setup on a Host
  1. From another host, use SSH to log in into the host that you are testing as the SSH user. $ ssh -l user-name host-name user-name. The user name for the SSH user's account on the host. ...
  2. In response to the prompt, type your password. If this step succeeds, your setup of SSH is complete.

How do I fix SSH service? ›

How to Fix the SSH Connection Refused Error
  1. Verify Your SSH Port. ...
  2. Check Your SSH Login Credentials. ...
  3. Ensure SSH Is Installed on the Server. ...
  4. Enable SSH Access on your Server. ...
  5. Resolve Server Firewall Conflicts with SSH.
Jun 19, 2024

How to reset SSH connection? ›

Restarting ssh is simple job, exeute:
  1. # /etc/init.d/ssh restart. OR.
  2. # service ssh restart. OR.
  3. $ sudo service ssh restart. If you are using Debian/Ubuntu/Mint Linux with systemd, use the systemctl command:
Mar 5, 2024

How do I see SSH errors? ›

Launch Control Panel > Administrative Tools > Event Viewer. To see only SSH Server events, select View > Filter to show the filter settings. In the Application Properties > Filter tab, select sshd in the Event source menu to display only SSH Server events. You may also apply other conditions when needed.

How to check if a SSH server is running? ›

You can try ssh localhost to test if it is running; if it respons with something like Connection refused , then it is not running. These commands must be run as root. If the server does not start automatically, try using the service sshd start command, or just reboot the computer.

How do I enable SSH connection? ›

(Select Start, type services.msc in the search box, and then select the Service app or press ENTER .) In the details pane, double-click OpenSSH SSH Server. On the General tab, from the Startup type drop-down menu, select Automatic and then select Ok. To start the service, select Start.

How do I get SSH to work? ›

How to Connect via SSH
  1. Open the command line/terminal window and run the following ssh command: ssh [username]@[host_ip_address] ...
  2. When connecting to the server for the first time, a message appears asking to confirm the connection. ...
  3. Provide the password when prompted and press Enter.
Nov 23, 2023

How to fix SSH connection refused? ›

6 ways to fix the SSH connection refused error
  1. Change the SSH port number. ...
  2. Double-check the credentials. ...
  3. Make sure SSH is enabled. ...
  4. Make sure SSH client is installed. ...
  5. Ensure SSH Daemon is installed on the server. ...
  6. Check your firewall settings.
Jul 23, 2024

How do I check my current SSH connection? ›

To list all connected SSH sessions, you can use the “who -a” command. The -a option shows all users, including those who are not logged in through the system console. The result will show your username, terminal, and login date and time.

How do you check if SSH is configured or not? ›

Check whether you have enabled SSH
  1. To check whether the SSH server has been installed, run the following command: systemctl -t service|grep sshd.
  2. If the SSH isn't installed on your node, run the following commands to install and start the SSH server. yum install openssh-server. systemctl enable sshd. systemctl start sshd.
Feb 1, 2024

How to troubleshoot SSH issues? ›

Troubleshooting the SSH Connection
  1. Verify the connection. Linux or MacOS. ...
  2. Add a public IP address. ...
  3. Instance is on a private subnet. ...
  4. Verify the network security lists. ...
  5. Confirm that the instance is accessible. ...
  6. Connect to the serial console. ...
  7. Confirm that SSH is running on the instance. ...
  8. Capture serial console history.
Jun 13, 2024

Why is SSH not connecting to port 22? ›

If a firewall on your local machine, within your network, or on the server is configured to block the SSH port (typically port 22), it will prevent an SSH connection. To resolve this, you need to adjust the firewall settings to allow traffic through the SSH port.

How to reboot a SSH server? ›

Let us follow the steps:
  1. Use SSH to access your server.
  2. Run this command by typing it in: sudo reboot.
  3. Your session will automatically end and the interface will exit once SSH starts the server reboot.
Oct 17, 2022

How do I maintain my SSH connection? ›

Windows operating systems
  1. Start PuTTY.
  2. Load your connection session.
  3. In the Category pane, click Connection.
  4. Under Sending of null packets to keep session active, in the Seconds between keepalives, type 240. ...
  5. In the Category pane, click Session.
  6. Click Save.
  7. Connect to your account and monitor the connection.

How do you check SSH service is running or not? ›

You can try ssh localhost to test if it is running; if it respons with something like Connection refused , then it is not running. These commands must be run as root. If the server does not start automatically, try using the service sshd start command, or just reboot the computer.

How can I improve my SSH connection? ›

Steps to improve SSH performance:
  1. Disable reverse DNS lookup on the SSH server. ...
  2. Disable GSSAPI authentication on the SSH server. ...
  3. Enable multiplexing to share and reuse SSH connections. ...
  4. Specify the authentication method manually in the SSH client. ...
  5. Use passwordless authentication. ...
  6. Use faster encryption algorithms.

Top Articles
Well-Being at 60: 7 Tips to Age Gracefully
Where To Easily Get a Money Order: 10 Best Places To Buy One
Hotels Near 6491 Peachtree Industrial Blvd
Lowe's Garden Fence Roll
Matgyn
Swimgs Yuzzle Wuzzle Yups Wits Sadie Plant Tune 3 Tabs Winnie The Pooh Halloween Bob The Builder Christmas Autumns Cow Dog Pig Tim Cook’s Birthday Buff Work It Out Wombats Pineview Playtime Chronicles Day Of The Dead The Alpha Baa Baa Twinkle
Myexperience Login Northwell
Winston Salem Nc Craigslist
What Are the Best Cal State Schools? | BestColleges
Gabriel Kuhn Y Daniel Perry Video
9192464227
Brgeneral Patient Portal
The Realcaca Girl Leaked
Learn How to Use X (formerly Twitter) in 15 Minutes or Less
Camstreams Download
Was sind ACH-Routingnummern? | Stripe
Crusader Kings 3 Workshop
Culvers Tartar Sauce
4302024447
Wordscape 5832
Transfer Credits Uncc
Nebraska Furniture Tables
Unlv Mid Semester Classes
Chelactiv Max Cream
Barber Gym Quantico Hours
Today Was A Good Day With Lyrics
Tripadvisor Napa Restaurants
Dewalt vs Milwaukee: Comparing Top Power Tool Brands - EXTOL
Horn Rank
January 8 Jesus Calling
Farm Equipment Innovations
Truck from Finland, used truck for sale from Finland
Ncal Kaiser Online Pay
In hunt for cartel hitmen, Texas Ranger's biggest obstacle may be the border itself (2024)
Craigs List Jax Fl
Planned re-opening of Interchange welcomed - but questions still remain
Emily Katherine Correro
Ket2 Schedule
42 Manufacturing jobs in Grayling
Chs.mywork
Viewfinder Mangabuddy
Gets Less Antsy Crossword Clue
Noaa Duluth Mn
Brake Pads - The Best Front and Rear Brake Pads for Cars, Trucks & SUVs | AutoZone
Woody Folsom Overflow Inventory
Craigslist Minneapolis Com
Zipformsonline Plus Login
Unblocked Games 6X Snow Rider
Acuity Eye Group - La Quinta Photos
Used Auto Parts in Houston 77013 | LKQ Pick Your Part
Sams La Habra Gas Price
La Fitness Oxford Valley Class Schedule
Latest Posts
Article information

Author: Delena Feil

Last Updated:

Views: 6757

Rating: 4.4 / 5 (45 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Delena Feil

Birthday: 1998-08-29

Address: 747 Lubowitz Run, Sidmouth, HI 90646-5543

Phone: +99513241752844

Job: Design Supervisor

Hobby: Digital arts, Lacemaking, Air sports, Running, Scouting, Shooting, Puzzles

Introduction: My name is Delena Feil, I am a clean, splendid, calm, fancy, jolly, bright, faithful person who loves writing and wants to share my knowledge and understanding with you.