Find the answer to your Linux question:
Results 1 to 6 of 6
I have a router sharing internet between two computers, C1 and C2, and would like to use ssh to access both of them remotely. I have read that I need ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2008
    Posts
    10

    ssh to computers behind a router


    I have a router sharing internet between two computers, C1 and C2, and would like to use ssh to access both of them remotely.
    I have read that I need to tell the router to forward all packets coming in to port 22 (SSH) to one of the computers, say C1. How, then will I be able access C2 remotely. Can you do ssh through another port?
    Thanks in advance.

  2. #2
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,393
    One thing I can think of is to configure ssh on C1 to listen on port 22 and then configure ssh on C2 to listen on a different port. If both computers are always switched on, you could ssh into C1 and then from C1 ssh into C2 (its a bit of a kludge, but should work).

  3. #3
    Just Joined!
    Join Date
    Feb 2008
    Posts
    10
    Thanks for the fast reply
    Do you know if you can do ssh through another port for C2 (like port 23 or some other available one).
    Accessing C2 through C1 should work for now though.
    Thanks again.

  4. #4
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,393
    Take a look at this article. If I find anymore docs about this issue I will post them.

  5. #5
    Just Joined!
    Join Date
    Feb 2008
    Posts
    10
    Another question -
    I logged in to my router and told it to forward port 22 to C1's private IP address, 192.168.0.5
    When I run ssh 192.168.0.5 on C2, I can gain access, but when I run ssh [my dynamic external ip address], the connection is refused.
    Could this be because C2 is not an outside computer?
    I cannot think of any other reason why this the router is not forwarding port 22

  6. #6
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,393
    I am not sure what exactly could cause that. Have you tried connecting via ssh from outside your network?

Posting Permissions

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