tamanutrition.blogg.se

Could not open connection to the host
Could not open connection to the host





Run the command “service sshd status” OR “service ssh status” to make sure the service is running # netstat -tupln | grep -i ssh Restart SSH service using command : service sshd ~]# service sshd restart Ssh service is not running on the above server and that is the reason why you’re unable to SSH to the server. Type the command ‘netstat -tupln | grep ssh’ to check whether SSH service is # netstat -tupln | grep -i #Ĭheck the status of SSH service: service ssh status OR service sshd status PermitRootLogin should be set to yes in SSH configuration # grep -i permit /etc/ssh/sshd_configĤ. My server had a custom SSH port number 2222 and that is the reason why port 22 was rejected with error message. Check whether you have set custom ssh port number in SSH configuration # grep Port /etc/ssh/ssh_config If you are having Amazon cloud server, the port number should be opened in the security group.Ģ. If you are using CSF firewall you must open the SSH port in CSF configuration file /etc/csf/csf.conf

could not open connection to the host

Open 22 port in server firewall and restart the firewall.Ĭommand to Open 22 Port : iptables -A INPUT -p tcp –dport 22 -j ACCEPT Type the command “iptables -nL” and make sure there is no rule blocking the port 22. Remove the iptables rule if your IP address is blocked. If you’re able to access SSH then the issue is related to the firewall.Ĭommand to check whether you’re IP address is blocked by the server firewall : iptables -nL | grepĮxample : iptables -nL | grep 192.168.2.5 Now check whether you’re able to SSH to the server. Log into your linux server through console access and disable the server firewall Your server might be having sudo, su access OR key based authenticationġ. Your IP address might be blocked by the server firewall.Ħ. PermitRootLogin might be disabled on your serverĥ. The server might be having a custom SSH port numberĤ. SSH service might not be running on your serverģ.

could not open connection to the host

SSH port 22 is not open/blocked by the server firewallĢ. It might be due to any of the below reasons you are unable to SSH to the linux server.ġ. I tried to SSH to my CentOS Linux server via putty and got the above error.







Could not open connection to the host