{"id":5625,"date":"2024-10-25T02:45:18","date_gmt":"2024-10-24T21:15:18","guid":{"rendered":"https:\/\/www.veeble.org\/kb\/?p=5625"},"modified":"2025-04-04T12:11:05","modified_gmt":"2025-04-04T06:41:05","slug":"how-to-fix-connection-timed-out-in-ssh","status":"publish","type":"post","link":"https:\/\/www.veeble.com\/kb\/how-to-fix-connection-timed-out-in-ssh\/","title":{"rendered":"How to Fix &#8220;Connection Timed Out&#8221; in SSH"},"content":{"rendered":"\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/10\/Connection-timed-out-error.jpeg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1792\" height=\"379\" data-id=\"5658\" src=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/10\/Connection-timed-out-error.jpeg\" alt=\"Connection timed out error in Linux SSH\" class=\"wp-image-5658\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/10\/Connection-timed-out-error.jpeg 1792w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/10\/Connection-timed-out-error-300x63.jpeg 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/10\/Connection-timed-out-error-1024x217.jpeg 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/10\/Connection-timed-out-error-768x162.jpeg 768w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/10\/Connection-timed-out-error-1536x325.jpeg 1536w\" sizes=\"auto, (max-width: 1792px) 100vw, 1792px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p>If you&#8217;ve attempted to establish an SSH connection to a remote server and received a &#8220;Connection Timed Out&#8221; error message, don\u2019t worry! This is a common issue&#8230;<\/p>\n\n\n\n<p>Here&#8217;s a step-by-step guide for easily fixing the SSH Connection Timed Out error. <strong>\ud83d\ude03<\/strong><\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-verse\">By the way, <strong>What does SSH \"connection timed out\" mean?<\/strong><br>This error happens when the computer tries to connect with a server through SSH and it waits for a response on the other end. If, in a certain amount of time, SSH doesn't connect, it says, \"Connection Timed Out.\" That really only tells you that your computer couldn't communicate with the server, but it's not sure exactly why.<\/pre>\n\n\n\t\t\t\t<div class=\"wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-5ddcbb31      \"\n\t\t\t\t\tdata-scroll= \"1\"\n\t\t\t\t\tdata-offset= \"30\"\n\t\t\t\t\tstyle=\"\"\n\t\t\t\t>\n\t\t\t\t<div class=\"uagb-toc__wrap\">\n\t\t\t\t\t\t<div class=\"uagb-toc__title\">\n\t\t\t\t\t\t\tQuick Summary of Fixes\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"uagb-toc__list-wrap \">\n\t\t\t\t\t\t<ol class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#check-if-the-server-is-running\" class=\"uagb-toc-link__trigger\">Check if the Server is Running<\/a><li class=\"uagb-toc__list\"><a href=\"#verify-the-ssh-port\" class=\"uagb-toc-link__trigger\">Verify the SSH Port<\/a><li class=\"uagb-toc__list\"><a href=\"#check-firewall-settings-on-your-pc-and-the-server\" class=\"uagb-toc-link__trigger\">Check Firewall Settings (on Your PC and the Server)<\/a><li class=\"uagb-toc__list\"><a href=\"#self-assessment-of-your-end-issues\" class=\"uagb-toc-link__trigger\">Self-Assessment of Your End Issues<\/a><li class=\"uagb-toc__list\"><a href=\"#increase-connection-timeout\" class=\"uagb-toc-link__trigger\">Increase Connection Timeout<\/a><li class=\"uagb-toc__list\"><a href=\"#check-server-logs-for-errors\" class=\"uagb-toc-link__trigger\">Check Server Logs for Errors<\/a><li class=\"uagb-toc__list\"><a href=\"#advanced-troubleshooting-optional\" class=\"uagb-toc-link__trigger\">Advanced Troubleshooting (Optional)<\/a><li class=\"uagb-toc__list\"><a href=\"#get-your-windows-vps-server-today\" class=\"uagb-toc-link__trigger\">Get Your Windows VPS Server Today<\/a><\/ol>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\n\n\n<p><\/p>\n\n\n<h2 class=\"wp-block-heading has-text-align-center\" id=\"solutions\"><span style=\"text-decoration: underline\">Solutions<\/span><\/h2>\n\n<h3 class=\"wp-block-heading\" id=\"check-if-the-server-is-running\">Check if the Server is Running<\/h3>\n\n\n<p>Make sure the server is up and running. You can verify this by pinging the server or by contacting the server administrator for its status.<\/p>\n\n\n\n<p>To ping the server, use the following command: replace the IP of your server with the IP of your machine.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ping &lt;ip_address&gt;<\/code><\/pre>\n\n\n\n<p>If you get a response like &#8220;Request Timed Out&#8221; or &#8220;Destination Host Unreachable,&#8221; the server might be down.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/10\/ping.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1111\" height=\"344\" data-id=\"5660\" src=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/10\/ping.png\" alt=\"If you're getting a 0% loss ping result then no need to worry about the internet connectivity issue inside the server.\" class=\"wp-image-5660\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/10\/ping.png 1111w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/10\/ping-300x93.png 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/10\/ping-1024x317.png 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/10\/ping-768x238.png 768w\" sizes=\"auto, (max-width: 1111px) 100vw, 1111px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"verify-the-ssh-port\">Verify the SSH Port<\/h3>\n\n\n<p>SSH uses port 22 by default, but the server might use a different port. If your server uses a custom port, you&#8217;ll need to specify it in the command. You can use the SSH connecting command like the below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh -p 2222 root@108.90.90.90<\/code><\/pre>\n\n\n\n<p>Remember to replace the username, server IP address, and SSH port with the correct values as of your server.<\/p>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"check-firewall-settings-on-your-pc-and-the-server\">Check Firewall Settings (on Your PC and the Server)<\/h3>\n\n\n<p>If a firewall is blocking your SSH connection, you must adjust its settings.<\/p>\n\n\n\n<p>On your local machine, make sure the firewall allows outgoing SSH connections on port 22, or whichever custom port is utilized.<br>On your server side, check whether SSH connections are allowed if you have access to the server by any means.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw allow ssh<\/code><\/pre>\n\n\n\n<p>Or, if SSH runs on a different port:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw allow &lt;port number&gt;<\/code><\/pre>\n\n\n\n<p>If you&#8217;re not using the UFW firewall, adjust these settings by referring to the blog: <a href=\"https:\/\/www.veeble.org\/kb\/how-to-open-a-specific-port-on-linux\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.veeble.org\/kb\/how-to-open-a-specific-port-on-linux\/<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"selfassessment-of-your-end-issues\">Self-Assessment of Your End Issues<\/h3>\n\n\n<ul class=\"wp-block-list\">\n<li>Open up any other site on your browser to make sure you are online and the Internet is working without issues.<\/li>\n\n\n\n<li>Check the Internet speed also via visiting the speed testing websites available in your search engine, such as <a href=\"https:\/\/www.speedtest.net\/\" target=\"_blank\" rel=\"noopener\">SpeedTest by Ookla<\/a>.<\/li>\n\n\n\n<li>Double-check the IP address of the server and make sure you&#8217;re using the correct one.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"increase-connection-timeout\">Increase Connection Timeout<\/h3>\n\n\n<p>You can increase the SSH timeout value to give the server more time to respond. Sometimes the server might be slow to respond, and the default timeout period might be too short. So to alter it and connect to the server, use the following command format:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh -o ConnectTimeout=30 user@server_ip_address<\/code><\/pre>\n\n\n\n<p>In this example, <code>30<\/code> represents the number of seconds before timing out.<\/p>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"check-server-logs-for-errors\">Check Server Logs for Errors<\/h3>\n\n\n<p>If you have access to the server logs, check them for any signs of SSH-related issues. You can usually find the logs in <strong>\/var\/log\/auth.log<\/strong> or <strong>\/var\/log\/secure<\/strong>, depending on your system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/var\/log\/auth.log<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-center\"><em>OR<\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/var\/log\/secure<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"advanced-troubleshooting-optional\">Advanced Troubleshooting (Optional)<\/h3>\n\n\n<p>If you are still facing issues connecting to SSH, it is recommended to check any blocks for your IP in your server&#8217;s firewall as well as the below blog SSH access regaining solutions:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-veeble-hosting wp-block-embed-veeble-hosting\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/www.veeble.org\/kb\/troubleshooting-ssh-connection-refused-error\n<\/div><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>The &#8220;Connection Timed Out&#8221; error in SSH can be frustrating, but with this guide, you can troubleshoot and fix the issue easily. Most of the time, the problem is with either a firewall, the wrong SSH port, or a network connection. By following these simple steps, you&#8217;ll be able to connect to your server in no time!<\/p>\n\n\n\n<div style=\"height:44px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-uagb-call-to-action uagb-block-14c2a6cb wp-block-button\"><div class=\"uagb-cta__wrap\"><h3 class=\"uagb-cta__title\">Get Your Windows VPS Server Today<\/h3><p class=\"uagb-cta__desc\">Deploy your Windows applications and websites with ease. Our reliable infrastructure ensures your online presence is always available.<\/p><\/div><div class=\"uagb-cta__buttons\"><a href=\"https:\/\/www.veeble.com\/in\/vps-hosting\/\" class=\"uagb-cta__button-link-wrapper wp-block-button__link\" target=\"_blank\" rel=\"noopener noreferrer\">Get Your VPS Now<svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\"><path d=\"M504.3 273.6l-112.1 104c-6.992 6.484-17.18 8.218-25.94 4.406c-8.758-3.812-14.42-12.45-14.42-21.1L351.9 288H32C14.33 288 .0002 273.7 .0002 255.1S14.33 224 32 224h319.9l0-72c0-9.547 5.66-18.19 14.42-22c8.754-3.809 18.95-2.075 25.94 4.41l112.1 104C514.6 247.9 514.6 264.1 504.3 273.6z\"><\/path><\/svg><\/a><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Are you facing a connection timed out error when trying SSH into your machine? Here is the guide to fix this issue easily!<\/p>\n","protected":false},"author":7,"featured_media":8475,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[5],"tags":[],"class_list":["post-5625","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"uagb_featured_image_src":{"full":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/10\/How-to-Fix-Connection-Timed-Out-in-SSH.jpg",1366,768,false],"thumbnail":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/10\/How-to-Fix-Connection-Timed-Out-in-SSH-150x150.jpg",150,150,true],"medium":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/10\/How-to-Fix-Connection-Timed-Out-in-SSH-300x169.jpg",300,169,true],"medium_large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/10\/How-to-Fix-Connection-Timed-Out-in-SSH-768x432.jpg",768,432,true],"large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/10\/How-to-Fix-Connection-Timed-Out-in-SSH-1024x576.jpg",1024,576,true],"1536x1536":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/10\/How-to-Fix-Connection-Timed-Out-in-SSH.jpg",1366,768,false],"2048x2048":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/10\/How-to-Fix-Connection-Timed-Out-in-SSH.jpg",1366,768,false]},"uagb_author_info":{"display_name":"Adrian Antony","author_link":"https:\/\/www.veeble.com\/kb\/author\/adrian\/"},"uagb_comment_info":0,"uagb_excerpt":"Are you facing a connection timed out error when trying SSH into your machine? Here is the guide to fix this issue easily!","_links":{"self":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/5625","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/comments?post=5625"}],"version-history":[{"count":22,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/5625\/revisions"}],"predecessor-version":[{"id":7195,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/5625\/revisions\/7195"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media\/8475"}],"wp:attachment":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media?parent=5625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/categories?post=5625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/tags?post=5625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}