Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Server details: OS: Linux RedHat DHCP: Static IP set to 192.168.1.101 sshd_config: Enabled for port 22 for ssh Connected through wire to the Linksys router Router: Type: Linksys BEFW11S4 Port ...
  1. #1
    idx
    idx is offline
    Just Joined!
    Join Date
    Apr 2011
    Posts
    6

    Help: Cannot access Linux Server behind the linksys router via ssh

    Server details:
    OS: Linux RedHat
    DHCP: Static IP set to 192.168.1.101
    sshd_config: Enabled for port 22 for ssh
    Connected through wire to the Linksys router

    Router:
    Type: Linksys BEFW11S4
    Port forwarding enabled for port 22 to IP 192.168.1.101

    Client:
    Windows 7
    Interface: PuTTy
    Host: 192.168.1.101 on port 22 through SSH

    This always gives an error "connection timed out".

    SSH directly on the local Linux works fine..

    Seems basic but had been struggling over this for past 3 hours to no avail so thought of posting it to the experts..please help. Am I missing anything?

    regards
    Idx.

  2. #2
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,114
    Client:
    Windows 7
    Interface: PuTTy
    Host: 192.168.1.101 on port 22 through SSH
    Where is this client? If it is on the local network (along
    with the server) it is correct to connect to 192.168.1.101,
    the server's local address, but if the client is outside the local
    network (somewhere out on the internet), then it must connect
    to the public address, the one the router connects to.

  3. #3
    idx
    idx is offline
    Just Joined!
    Join Date
    Apr 2011
    Posts
    6

    client is in the same network

    Quote Originally Posted by rcgreen View Post
    Where is this client? If it is on the local network (along
    with the server) it is correct to connect to 192.168.1.101,
    the server's local address, but if the client is outside the local
    network (somewhere out on the internet), then it must connect
    to the public address, the one the router connects to.
    Thanks for your comment..
    The client is also within the same LAN basically connected to the same router (tried both wired and wireless but didn't make any difference)..the client ip is 192.168.1.xxx.

  4. #4
    idx
    idx is offline
    Just Joined!
    Join Date
    Apr 2011
    Posts
    6
    Do I have to put anything in the iptables config file?

  5. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Are you able to ssh to this computer from another inside the LAN (behind the router/firewall)?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #6
    idx
    idx is offline
    Just Joined!
    Join Date
    Apr 2011
    Posts
    6
    No, that is exactly the problem..i haven't tried "outside" the firewall as behind the router itself is not working. Basically, it is like 192.168.1.100 (client) connecting to 192.168.1.101 (server) through SSH on port 22..sounds so simple..but is not working.

  7. #7
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Quote Originally Posted by idx View Post
    No, that is exactly the problem..i haven't tried "outside" the firewall as behind the router itself is not working. Basically, it is like 192.168.1.100 (client) connecting to 192.168.1.101 (server) through SSH on port 22..sounds so simple..but is not working.
    Ok. Then it is probably an iptables rule problem. Post the output of 'iptables-save' here. Also, you might try stopping the iptables services and then trying to connect with ssh again. I had a problem connecting with NFS recently on my new Linux installation for this reason. I was able to alter the iptables in-kernel rules so that nfs works again, but I had to disable iptables at first to verify that it was the cause of my connection problem.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  8. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Ditto using OpenVPN to connect from outside the firewall. The NFS clients were inside.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #9
    idx
    idx is offline
    Just Joined!
    Join Date
    Apr 2011
    Posts
    6
    Output of iptables-save:

    # Generated by iptables-save v1.2.8 on Wed Apr 20 17:01:49 2011
    *filter
    :INPUT ACCEPT [0:0]
    :FORWARD ACCEPT [0:0]
    :OUTPUT ACCEPT [5071:847593]
    :RH-Firewall-1-INPUT - [0:0]
    -A INPUT -j RH-Firewall-1-INPUT
    -A FORWARD -j RH-Firewall-1-INPUT
    -A RH-Firewall-1-INPUT -i lo -j ACCEPT
    -A RH-Firewall-1-INPUT -p icmp -m icmp --icmp-type 255 -j ACCEPT
    -A RH-Firewall-1-INPUT -p esp -j ACCEPT
    -A RH-Firewall-1-INPUT -p 22 -j ACCEPT
    -A RH-Firewall-1-INPUT -p ah -j ACCEPT
    -A RH-Firewall-1-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
    -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
    COMMIT
    # Completed on Wed Apr 20 17:01:49 2011

  10. #10
    idx
    idx is offline
    Just Joined!
    Join Date
    Apr 2011
    Posts
    6
    rubberman-disabling the iptable worked..so it has to do something with my iptables..do you see anything missing there?

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...