Networking Forums

Networking Forums > Computer Networking > Linux Networking > ssh -R from work to home and ssh from home to work

Reply
Thread Tools Display Modes

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

 
 
Sean
Guest
Posts: n/a

 
      10-04-2003, 09:12 AM
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

So I am now working from home. The problem is that $DISPLAY is not
set. This doesn't pose a problem yet because X forwarding is still
sending Xwindows to my home display. The issue is: after I ssh to
work and then ssh to another network server the $DISPLAY variable is
set to the display of the original machine I ssh'd to and Xwindows are
now sent to it rather than home.

I don't know why $DISPLAY is not set on the original ssh but all I
want is for the windows from the second ssh'd to server to end up at
home. Is the first problem the cause of the second? More
importantly, how do I solve the second problem.

Thanks for any help.
Sean
 
Reply With Quote
 
 
 
 
Bit Twister
Guest
Posts: n/a

 
      10-04-2003, 02:09 PM
On 4 Oct 2003 02:12:06 -0700, Sean 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
>
> So I am now working from home. The problem is that $DISPLAY is not
> set. This doesn't pose a problem yet because X forwarding is still
> sending Xwindows to my home display. The issue is: after I ssh to
> work and then ssh to another network server the $DISPLAY variable is
> set to the display of the original machine I ssh'd to and Xwindows are
> now sent to it rather than home.
>
> I don't know why $DISPLAY is not set on the original ssh but all I
> want is for the windows from the second ssh'd to server to end up at
> home. Is the first problem the cause of the second? More
> importantly, how do I solve the second problem.


for starters do a man ssh and try -X on each ssh.
 
Reply With Quote
 
Sean
Guest
Posts: n/a

 
      10-04-2003, 05:16 PM
> > 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.
 
Reply With Quote
 
Bit Twister
Guest
Posts: n/a

 
      10-04-2003, 07:16 PM
On 4 Oct 2003 10:16:40 -0700, Sean 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.


Ok, I'll guess work's sshd config file has been set to not forward
the display variable.

 
Reply With Quote
 
David Efflandt
Guest
Posts: n/a

 
      10-05-2003, 04:52 AM
On 4 Oct 2003 10:16:40 -0700, Sean <(E-Mail Removed)> 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/
 
Reply With Quote
 
Sean
Guest
Posts: n/a

 
      10-05-2003, 04:57 AM
Bit Twister <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> On 4 Oct 2003 10:16:40 -0700, Sean 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.

>
> Ok, I'll guess work's sshd config file has been set to not forward
> the display variable.


You are right. I have since solved the problem.

Thanks
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Work at Home PC To PC!!! Lisa Broadband 0 08-04-2008 06:08 PM
Work From Home zhivagos Home Networking 1 06-23-2005 10:39 PM
XP - home/work Greg Wireless Networks 2 04-20-2005 08:47 PM
Can I connect to my home pc from work? Noel S Pamfree Broadband 9 12-10-2004 08:32 AM
Work From Home Julie Home Networking 0 07-12-2004 01:40 PM



1 2 3 4 5 6 7 8 9 10 11