Results 1 to 5 of 5

Thread: SSH into machine without external IP

  1. #1
    Join Date
    Mar 2011
    Beans
    3

    SSH into machine without external IP

    Hi,

    I have two machines sitting in different offices.

    Machine A is an ubuntu server box which does not have an external IP address, but is connected to the internet.

    Machine B is an ubuntu server box which does have an external IP address (and is connected to the internet).

    As it stands, machine B cannot ssh into machine A, only the other way around. What I was wondering is is it possible for machine A to setup some sort of tunnel which machine B can then use to connect back to machine A? I only need SSH access, and I only need it from Machine B to Machine A.

    Any help on this matter is very much appreciated,
    Thank you.

  2. #2
    Join Date
    Dec 2010
    Beans
    549

    Re: SSH into machine without external IP

    Every machine on your network will have an IP address, possibly only an internal one. It may also be different every time you login to the network, although it is possible to bind a static IP to each machine. Internal network addresses are typically of the form 192.168.0.X. Then you can ssh to the machine, assuming it has the necessary ssh server software and is configured to let you in.

  3. #3
    pricetech is offline Iced Blended Vanilla Crème Ubuntu
    Join Date
    Apr 2008
    Beans
    1,656

    Re: SSH into machine without external IP

    Are you able to configure, or have configured for you, port forwarding on "router a" ??

  4. #4
    Join Date
    Mar 2011
    Beans
    3

    Re: SSH into machine without external IP

    Looks like I have managed to solve most of the problem:

    Code:
    MachineA: autossh user@MachineB -R 8022:localhost:22 -f -N
    MachineB: ssh user@localhost -p 8022
    The only problem now is that if MachineB restarts, then autossh seems to think it shouldn't reconnect. (It only reconnects if there is an error).

  5. #5
    Join Date
    Mar 2011
    Beans
    3

    Re: SSH into machine without external IP

    Thanks for your help lithospan & pricetech.

    I should have mentioned that I don't want MachineA to have an external IP. MachineA is just a normal internal server on the network at OfficeA and MachineB is a dmz server at OfficeB.
    Opening up MachineA with a public IP & routing ports to it normally would require far to much work both from a firewall point of view and from an internal office politics point of view.

Tags for this Thread

Bookmarks

Posting Permissions

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