Re: ssh -R from work to home and ssh from home to work

From: David Efflandt (efflandt_at_xnet.com)
Date: 10/05/03


Date: Sun, 5 Oct 2003 04:52:37 +0000 (UTC)

On 4 Oct 2003 10:16:40 -0700, Sean <seanss@earthlink.net> wrote:
>> > While I am at work I run:
>> >
>> > ssh -R 5022:localhost:22 user@host -c blowfish
>> >
>> > While I am at home I run:
>> >
>> > ssh -X -p 5022 different_user@localhost -C -c blowfish
>> >
>>
>> for starters do a man ssh and try -X on each ssh.
>
> First of all thanks for responding.
>
> So, I tried:
> While I am at work I run:
> ssh -X -R 5022:localhost:22 user@host -c blowfish
> While I am at home I run:
> ssh -X -p 5022 different_user@localhost -C -c blowfish
>
> And still, after I ssh from home to work:
> prompt> echo $DISPLAY
> DISYLAY: Undefined variable.

I don't think you should use the -X from work to home (if it is not your
intent to display X at work). Do you do ssh to the tunnel from an xterm
at home? However, I think the problem is that the ssh to the tunnel makes
you appear for all intents and purposes to be on localhost on the other
end of the tunnel, so that might be where an X program might try to
display (if there was an X server running there). If there is no X server
there, that might be why DISPLAY is undefined.

For example when I stopped my local smtp, created an ssh tunnel
25:127.0.0.1:25 to another internet host (as local root and remote normal
user) and then sent mail as a normal user, ident in the mail headers
showed that the connection was from root@localhost, but I was definitely
not root at that localhost (not sure if that was because sshd was running
as root or because the tunnel was initiated as my root). But from the
point of view on the remote, the mail appeared to come from its localhost.

So you might need to purposely tunnel X back from some port on the remote
localhost back to your localhost (with -R switch so remote localhost could
connect to it). For example, you might try using -R 6010:127.0.0.1:6000
and not -X, and then set DISPLAY on remote to localhost:10.0 (kind of like
X11Forward normally does).

-- 
David Efflandt - All spam ignored  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


Relevant Pages

  • local v remote
    ... On my localhost this works fine ... id, display FROM NEWS"); ... but on my remote i get a mysql_fetch_assoc: ... PHP version problem? ...
    (php.general)
  • SUMMARY: X11-SSH Tunnelling "Update" Problem with NetBackup
    ... think that the DISPLAY variable indicates that they are running ... Use VNC and tunnel that instead. ... > the window and click, some of the text charaters show up under your clicks. ... > Rather than tunnel the TCP through SSH, ...
    (SunManagers)
  • Re: X11 Forward : entire desktop ?
    ... the connection is comming (via a tunnel) from the localhost. ... every X application can be displayed on any Xserver ... do so (e.g. the xhost + command). ... display adapter on the local host. ...
    (comp.security.ssh)
  • Re: A question about Checkpoint firewall and Telnet over VPN
    ... I have been trying different options to resolve an issue with a remote ... I have the tunnel up and working. ... Since I am using Shiva VPN devices, I have tried using their Shiva ... VPN connection via an ADSL connection that connected to the company LAN ...
    (comp.security.firewalls)
  • Re: A question about Checkpoint firewall and Telnet over VPN
    ... I have been trying different options to resolve an issue with a remote ... I have the tunnel up and working. ... Since I am using Shiva VPN devices, I have tried using their Shiva ... The only problem is with the telnet session from that remote site ...
    (comp.security.firewalls)