Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] SSH Tunnels and X Forwarding
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
einheitlix
Tux's lil' helper
Tux's lil' helper


Joined: 03 Aug 2004
Posts: 144
Location: Saarbrücken, Germany

PostPosted: Tue Sep 30, 2008 10:44 am    Post subject: [SOLVED] SSH Tunnels and X Forwarding Reply with quote

Hi all,

I'm having a problem setting up an SSH connection with X Forwarding in a very special setup, and hope you will be able to help me.

The setup is as follows: I live in a student residence and have a computer there named ririu. This computer isn't reachable from the outside, as the university's computer center blocks all ingoing connections to the residence from the outside.
The only reachable computer from the outside is our server in the residence, hal, for which the computer center makes an exception.

I'm now at my parent's place and want to build up an SSH connection with X Forwarding from my computer here, freya, to ririu, my computer in the residence. As hal is in the same LAN as ririu, obviously I can connect from freya to hal, and then from hal to ririu.

So I can also log in to hal and do a
Code:

malte@hal $ ssh -g -L 2508:ririu:22 malte@ririu

to build up an SSH tunnel. Then I can connect from freya to ririu using
Code:

malte@freya $ ssh -p 2508 malte@hal

This works like a charm. However, now I also want to have X Forwarding ;)

So I tried to specify -X as an additional parameter.
Code:

malte@freya $ ssh -p 2508 -X malte@hal

I do succeed in connecting to ririu. Except that the X forwarding doesn't work!
Code:

malte@ririu $ firefox
Error: no display specified
malte@ririu $ echo $DISPLAY

malte@ririu $


An X Forwarding to hal works flawlessly:
Code:

malte@freya:~$ ssh -X malte@hal
malte@hal $ echo $DISPLAY
localhost:11.0


...I can start X applications on hal and they are displayed on freya. But as you see, when I try to this from freya through an SSH tunnel from hal to ririu, the DISPLAY variable somehow gets lost. It doesn't help to randomly set the DISPLAY variable on ririu to localhost:11.0 or localhost:10.0 either, which I tried in desperation.

I hope I made it clear what the problem is, otherwise just ask :)
Do you have any idea why this isn't working? I would have assumed that ssh doesn't even notice it's running through an SSH tunnel and that this should hence work without problems. But it doesn't... so, is there any way for me to build up an ssh connection with X forwarding from freya to ririu at all?

Thanks for your help :)
_________________
Collecting data is only the first step toward wisdom. But sharing data is the first step toward community.


Last edited by einheitlix on Thu Oct 02, 2008 7:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
michael_
n00b
n00b


Joined: 12 Jun 2007
Posts: 73
Location: Trier

PostPosted: Tue Sep 30, 2008 11:28 am    Post subject: Reply with quote

hi,

i have not really concerned with ssh, but did you tried -Y (trusted forwarding) instead of -X.


greetings from trier ;-)
Back to top
View user's profile Send private message
einheitlix
Tux's lil' helper
Tux's lil' helper


Joined: 03 Aug 2004
Posts: 144
Location: Saarbrücken, Germany

PostPosted: Tue Sep 30, 2008 12:24 pm    Post subject: Reply with quote

Thanks for your answer. I just tried it, but unfortunately, same effect with -Y instead of -X... although it seemed like a good idea :)
_________________
Collecting data is only the first step toward wisdom. But sharing data is the first step toward community.
Back to top
View user's profile Send private message
meyerm
Veteran
Veteran


Joined: 27 Jun 2002
Posts: 1307
Location: Munich / Germany

PostPosted: Tue Sep 30, 2008 4:25 pm    Post subject: Reply with quote

BTW: You can get X-apps from ririu by sshing "manually":

Code:
freya # ssh -Y hal
hal # ssh -Y ririu
ririu # xterm // displayed on freya
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 6348

PostPosted: Wed Oct 01, 2008 3:57 am    Post subject: Reply with quote

Does ririu ever allow X forwarding? The sshd configuration can prohibit it system-wide, so perhaps it is blocked there and would not work even in the simple case of a direct connection from freya to ririu.
Back to top
View user's profile Send private message
einheitlix
Tux's lil' helper
Tux's lil' helper


Joined: 03 Aug 2004
Posts: 144
Location: Saarbrücken, Germany

PostPosted: Thu Oct 02, 2008 7:16 pm    Post subject: Reply with quote

Hu, you were perfectly right. I just didn't configure the sshd on ririu to allow X11Forwarding. What a silly mistake... thanks a lot, now it works like a charm :)

All, thanks for all of your kind answers!

Cheers,
Malte
_________________
Collecting data is only the first step toward wisdom. But sharing data is the first step toward community.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum