ssh into OS X with X tunneling

icarus4586

Senior member
Jun 10, 2004
219
0
0
I have a Mac at home that already has sshd enabled, so that I can connect to it remotely with SSH. I also have X11 installed on it. When you SSH into a usual Unix/Linux box running X11, you can use the -X or -Y flag to enable X tunneling. When I use this flag when I SSH into my Mac, it appears to work (no error messages anyway), but if I run a program that uses X, it never comes to my screen here. Any insight?
 

M00T

Golden Member
Mar 12, 2000
1,214
1
0
-X is supposed to set $DISPLAY for you.

Is there another box you can test with, or even try tunneling in the reverse direction?
 

icarus4586

Senior member
Jun 10, 2004
219
0
0
On the machine I'm on now, $DISPLAY = :0.0
On my mac, $DISPLAY wasn't set, so I set it to (my ip address here):0.0

It still doesn't seem to be working tho.
 

M00T

Golden Member
Mar 12, 2000
1,214
1
0
Follow these steps and paste the terminal output:
-----------------
xhost +
ssh -X machine
echo $DISPLAY
xterm
-----------------

Show us what happens when you run all that in the same terminal
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
I'm not sure if ssh's command line options supercede the options in sshd_config, so make sure X11 tunneling is enabled there.

-X is supposed to set $DISPLAY for you.

I know, but stuff happens. ;)
 

icarus4586

Senior member
Jun 10, 2004
219
0
0
$ xhost +
access control disabled, clients can connect from any host

$ ssh -X -l (username) (mac's hostname)
Password:
Last login: Thu Aug 10 09:04:12 2006 from (ip-address)
Welcome to Darwin!
adding /sw/bin to PATH...
done

ntp0166@razor:~
$ echo $DISPLAY


ntp0166@razor:~
$ xterm
-bash: xterm: command not found
 

M00T

Golden Member
Mar 12, 2000
1,214
1
0
No display is set and you don't have xterm in your path. Seems to be a larger problem here. See the info below.

OSX stuff

EDIT: Well, nevermind. None of that is going to be any help. Sorry.
 

icarus4586

Senior member
Jun 10, 2004
219
0
0
n0cmonkey hit the nail on the head. I edited /etc/sshd_config to enable X tunneling and set display offset, and it works now.

Thanks!