Re: piggy-backing through an ssh session

From: Mark Gordon (spamtrap@flash-gordon.me.uk)
Date: 10/22/02


Date: Tue, 22 Oct 2002 17:05:59 +0100
From: Mark Gordon <spamtrap@flash-gordon.me.uk>

On 20 Oct 2002 22:30:42 -0700
alan@internal.wj.com (Alan Strassberg) wrote:

> Is this possible: ssh from box A behind a firewall to
> box B on the Internet. On box B 'hijack' the ssh session and
> connect back to box A ?
>
> I'm donating some time to a school that only has dialup on
> inbound but is Internet connected. Would be handy to be able
> to connect back assuming I can piggyback on an existing session.
> Plus I've always wondered if this was possible.

When you ssh from box A to box B you can port forward port 1234 on box B
to port 22 on box A to allow you to ssh back from box B to box A. An
example hacked from my .ssh/config file at home (boxa) is:

host boxb
RemoteForward 1234 localhost:22

On box B you can then have in the .ssh/config file:

host boxa
HostName localhost
Port 2222

I use this to ssh into the office (which I am allowed to do) before I
leave home in the morning. Then I use "ssh boxa" to shell onto my
machine at home.

This method only allows boxb to ssh to boxa. If you want other machines
on the same network as boxb to be able to ssh via boxb to boxa you will
have to investigate prot forwarding a bit more yourself. I've not tried
since I only want the one machine to be able to get in to my home
network.

-- 
Mark Gordon
Paid to be a geek.



Relevant Pages

  • Re: X11 forwarding in OpenSSH question
    ... I don't neet to set DISPLAY variable to hostA:0.0. ... BoxA runs X server and BoxB runs sshd ... > that md5sum cookies do not work in the first ssh case. ...
    (comp.security.ssh)
  • Re: ssh gives "Permission denied, please try again"
    ... port 22 on your internal machine, so you will need to keep ssh up to ... I configure the router to forward a different external port to 22 on my ... For good measure pick usernames that are none obvious, ... root/password: 163 times ...
    (uk.comp.os.linux)
  • [NEWS] SSH service at Dell DRAC4 Denial of Service (Mocana)
    ... SSH service at Dell DRAC4 Denial of Service ... Dell Remote Access Card 4 allows customers to effectively manage ... After the use of such a port scanner, ...
    (Securiteam)
  • Re: Remote Desktop directly to another computer on the network
    ... default port... ... And there is no reason for me to believe that ssh ... When I have a multibillion company I will use the key pair, ... WinSCP for that to access my home SSH server. ...
    (microsoft.public.windowsxp.work_remotely)
  • Re: SSH safety
    ... SSH safety (J.L. ... FC3 missing KDE menu items ... I was wondering how safe it is to open the ssh port up to the internet. ...
    (Fedora)