PuTTY Connection Refused

Discussion in 'HOWTO-Related Questions' started by expatCM, Dec 3, 2007.

  1. expatCM

    expatCM New Member

    I am following The Perfect Server for Gutsy. I am up to page 3 where it says "From now on you can use an SSH client and connect from your workstation".

    I cannot. I use putty and get Connection Refused.

    I have not been playing with anything so the server setup is as described in the guide and I have used both the PuTTY gui and cli and get the same message.

    Do I need to open port 22 on IPtables (if so, how) or is there something else I should look at?
     
  2. expatCM

    expatCM New Member

    After looking round the Internet I got the idea that the following may help but I still get Connection Refused

    iptables -A INPUT -i eth1 -p tcp --dport 22 -j ACCEPT
     
  3. volksman

    volksman New Member

    You can always shut off iptables temporarily to test if its a firewall issue.

    ps aux|grep ssh

    should return at least one line with sshd on it.

    Lastly make sure putty isn't trying to telnet as opposed to ssh. Different versions of putty will default to telnet which is port 23 and not running be default on newer linux distros for security reasons (nor should it be).

    Hope that helps!
     
  4. expatCM

    expatCM New Member

    Thank you for your suggestions. Sadly still no luck ... connection still refused ..

    I ran the command on both the server and the client.

    On the server I got two lines which I summarize as

    root ? Ss /usr/sbin/sshd
    root tty1 R+ grep ssh

    On the client I got three lines which I also summarize as

    root ? Ss /usr/sbin/sshd
    user1 ? Ss /usr/bin/ssh-agent x-session-manager
    user1 pts/0 R+ grep ssh

    I also booted the client with a Live CD and tried again. Same result.

    The PuTTY gui client shows that port 22 is the default.

    Any ideas?
     
  5. expatCM

    expatCM New Member

    I appear to have got this working but whilst I can see the problem I do not understand it.

    If I ping hostname I get a response but it relates to opendns and not my local network

    PING hostname (208.67.219.130) 56(84) bytes of data.
    64 bytes from nxdomain.guide.opendns.com (208.67.219.130): icmp_seq=1 ttl=240 time=320 ms
    64 bytes from nxdomain.guide.opendns.com (208.67.219.130): icmp_seq=3 ttl=240 time=321 ms
    64 bytes from nxdomain.guide.opendns.com (208.67.219.130): icmp_seq=4 ttl=240 time=318 ms
    64 bytes from nxdomain.guide.opendns.com (208.67.219.130): icmp_seq=5 ttl=240 time=318 ms

    but if I ping the ip address

    PING 192.168.1.125 (192.168.1.125) 56(84) bytes of data.
    64 bytes from 192.168.16.70: icmp_seq=1 ttl=64 time=1.49 ms
    64 bytes from 192.168.16.70: icmp_seq=2 ttl=64 time=0.094 ms
    64 bytes from 192.168.16.70: icmp_seq=3 ttl=64 time=0.092 ms
    64 bytes from 192.168.16.70: icmp_seq=4 ttl=64 time=0.093 ms
    64 bytes from 192.168.16.70: icmp_seq=5 ttl=64 time=0.094 ms
    64 bytes from 192.168.16.70: icmp_seq=6 ttl=64 time=0.080 ms

    So if I then use putty ipaddress on the cli it will connect.

    I simply do not understand why the hostname will not connect.
     
  6. o.meyer

    o.meyer New Member Moderator

    Hi expatCM,

    if you want to use hostnames to connect to machines in your LAN you need to add the hostnames and depending IP's to the hosts file..

    Linux -> /etc/hosts
    Windows -> C:\Windows\System32\drivers\etc\hosts

    ..or setup a DNS-server for your LAN. In your actual situation (without one of the two solutions from above) the systems don't know each others hostnames - so they search the hostnames via your ISP's DNS-servers out in the web - but logically they are not existing.

    Best regards,

    Olli
     
  7. expatCM

    expatCM New Member

    I think I sort of understand ..... I followed the tutorial and whilst I gave a host name it sounds like what you are saying is that my existing setup looks to opendns as a default and in this case found something to direct the ping to. So I guess the problem will go away after I have edited the hosts file which I see is just a few steps away.

    Thanks for commenting ... perhaps basic stuff for you but a building block for me :)
     
  8. o.meyer

    o.meyer New Member Moderator

    And don't forget to edit the hosts-file on the workstation which you are using to connect to the server.

    Olli
     

Share This Page