I have centos 6.9 installed in one of my machines.
I have a difficulty enabling ssh for remote connection. I always get "Refused Connection" in Putty.
I can use ssh via localhost. Iptables shows that incoming connection is accepting port 22.

Below command is how i use to connect via terminal/server.

root: ssh xx@localhost

My connection is directly to my modem isp.


I am trying to access my sever from the internet and i got connection refused error. From localhost ssh is good but outside localhost i got error.

I've been debugging this whole day now. Can't find any solution.

Do you have any solution?

  • What is your ssh command (sanitized for secrets)? Can you ping the host used in that command from where you are connecting? – ajeh May 9 '18 at 21:55
  • sorry what do you mean by that? what do you mean ping in that command? getting confuse.. sorry. – buhatar May 9 '18 at 23:26
  • Step 1: provide the full ssh command you are using (not in comment, update the question). We'll go from there. Replace user name and password with fake of course. – ajeh May 10 '18 at 0:01
  • post is now updated. – buhatar May 10 '18 at 13:42
  • You said earlier that localhost works, so what command is causing the problem? – ajeh May 10 '18 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.