Find the answer to your Linux question:
Results 1 to 3 of 3
Hi Linux Forumers, I have a ssh server on a computer connected to a LAN at home and would like to access it from within the LAN and from my ...
  1. #1
    Just Joined!
    Join Date
    Mar 2010
    Posts
    15

    ssh server connection refused

    Hi Linux Forumers,

    I have a ssh server on a computer connected to a LAN at home and would like to access it from within the LAN and from my office outside of the LAN.

    From a computer on the LAN, if I type the local address 192.168.1.40, I have no pb, but when I type the public IP address of the router, I get a 'connection refused' error. This happens (and is most problematic) when I connect from outside. (I actually use a dyndns which I know links the address properly because I used to have a simple FTP server which worked fine).

    How can I set up my server so that it accepts incoming connections from the Internet?

    NB: The firewall of the router is set to forward port 22 tcp to the server and I know this feature works fine because I'm also using other services with other ports which are forwarded ok. The firewall of the server is set to allow connections on port 22 from anywhere.

    I've looked for the information but haven't found any answer. I am conscious that what I'm doing is dangerous as I expose the computer. Any security tips are welcome, besides the great "Top 20 OpenSSH Server Best Security Practices" whose address I'll be allowed to share after I have 15 posts on linux forums.

    Thanks a lot!
    Max

  2. #2
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,102
    Could you try and open port -say- 2222 on the router and forward that to port 22 on 192.168.1.40.

    Other than that:
    Use tcpdump to trace what happens where.
    Last edited by Irithori; 03-14-2010 at 09:44 PM.
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Mar 2010
    Posts
    15
    Thanks Irithori, I did change the port number as you suggest and it turns not to be the problem.
    Thanks for the tcpdump command. Nice thing to know about.

    Actually I've tried to connect from a distant computer and it works, so what remains of my problem is why am I not able to connect from within the LAN by targeting the public IP. No traffic is seen on the server. It's as if the dyndns was not routing when it comes from the same IP as it's supposed to forward the request. I'd have to see the router's logs for that. I don't think I'm going to bother too much with that.

    Thanks a lot,
    Max

Posting Permissions

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