•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Backup
    • Content Delivery Network
    • Colocation Hosting
    • Dedicated Hosting
    • DDoS Mitigation
    • IP Transit
    • Private Cloud
    • Wavelength
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • Dedicated Servers
    • Colocation
    • Private Cloud
    • DDos Protection
    • IP Transit
    • CDN
    • Backup
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

SSH Connection refused

  • Home
  • Client
  • Qa Forum
  • SSH Connection refused

Posted By: Henry | 1 Replies | Last Reply On: Oct 15, 2017 03:39:54

I keep getting the error below and would appreciate it if someone can provide some steps to fix it -

ssh: connect to host  port 22: Connection refused

 

Psychz - Raviteja

Votes: 0Posted On: Oct 15, 2017 03:39:54
 

You can get this error due to multiple reasons. The SSH connection might be refused either at the router, your firewall or there might be a problem with the SSH daemon. Here are some of the steps you can take to troubleshoot this problem. Here we are troubleshooting the problem on Ubuntu operating systems. 


Check your SSH daemon

Check the status the SSH daemon installed on both machines.

sudo service ssh status   
sudo service ssh start
 

If the status is active and running, then we move onto the other diagnosis. But if the SSH daemon is not installed on either of the machines, we have to reinstall the SSH daemon.

sudo apt-get remove openssh-client openssh-server
sudo apt-get install
openssh-client openssh-server

Try and connect through SSH now. If the problem is resolved, you don't need to proceed further. If not, move on to next steps.


Firewall Settings

The SSH daemon might be blocked by your internal firewall(iptables in this case). Please check your iptables to check that the port 22 is not blocked.

sudo iptables -L

If the port 22 is blocked, please run the following command to allow the SSH traffic.

sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT


Change the SSH port

Sometimes, the default port of SSH i.e Port 22 is blocked by the iptables or the ISP. Please change the port and restart the SSH service. You can do so by changing the SSH configuration file which is stored in "/etc/ssh/sshd_config". Edit the file using any editor of your choice. Here is sample shot of the file.


I am sure this will help in resolving your problem.

Was this reply helpful?

Related topics

  • Unable to Access The Server Via SSH
  • How to remotely connect to a Linux machine using a smartphone?
  • Dedicated with good connection to south america
  • ssh_exchange_identification connection closed by remote host
  • SSH Reverse Tunnel
  • SSH File Transfer
  • SSH Agent Forwarding
  • How To Secure cPanel?
  • ssh host key verification failed error
  • DDoS Extortion: The Latest Nefarious Twist on Cyber Crime
  • Firewalld commands for CentOS 7 and CentOS 8
  • Single vs Dual vs Multi-homed Network
  • Why Gaming Companies are Choosing Bare Metal Servers
  • The Hybrid Cloud: Making Almost Everyone Happy
  • Cloud Hosting vs. Dedicated Server - How Do You Choose?
Hosting Services
  • Dedicated Hosting
  • Colocation Hosting
  • Backup
  • IP Transit
  • DDoS Mitigation
Support
  • Portal Login
  • Knowledgebase
  • Community
Company
  • About Us
  • Contact Us
  • Network
  • Data Centers
  • Looking Glass
  • Affiliates
  • Reseller
  • Blog
Policies
  • Privacy Policy
  • Acceptable Usage Policy
  • Terms and Conditions
  • Service Level Agreement
Company
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801
Subscribe to Our Mailing List
* indicates required
Copyright © 2023 Psychz Networks, A Profuse Solutions Inc Company