ssh -x and XForwarding into OS X from a Linux Box

robpatrick

Registered
Would somebody be kind enough to help me "ssh -X" from a Linux machine into my Powerbook with OS X?

"ssh -X" from my Powerbook to the Linux machine works fine (I can pull up the WindowManager and use the GUI desktop as if I was at the Linux box. Simple ssh (without XForwarding) into my Powerbook from another location works fine.

What I'd like to do is "ssh -X" into MY computer and pull up WindowMaker. In other words, login to my Powerbook (which is running XFree86 and WindowMaker) and pull up the X-Windows desktop and use the GUI system remotely, through XForwarding.

So, here's where I'm at so far...

Let's call the outside machine "outside" and my machine "powerbook." I'm logging into my powerbook from the outside machine. Here's what I type after I've logged in with "ssh -X powerbook.ip.address":

outside$ setenv DISPLAY "outside.ip.address":0.0
outside$ xhost + "powerbook.ip.address"

and at this point it gives me an error:
outside$ xhost: unable to open display "powerbook.ip.address:0.0"

Even if I get past that, I get the same problem:

(after ssh'ing to my powerbook)
powerbook$ export DISPLAY="powerbook.ip.address:0"
powerbook$ startx (or twm, or whatever window manager I like)
powerbook$ twm: unable to open display "outside.ip.address:0"

Any ideas? I've tried a couple small changes to ssh_config and sshd_config (Like "X11Forwarding yes") that actually just ended up messing up ssh in general and cause Darwin to exit me out at login (real weird).

I know this is a hardcore UNIX thing to do.. but I think I'm pretty close to getting it. It really SHOULD work. (By the way, how do I find out what the IP Address of the machine I'm currently at is, in the terminal?)

Thanks to anyone who can attempt a solution or advice,
Rob
 

blb

`'
Setting

X11Forwarding yes

in /etc/sshd_config is the way it's supposed to be done, however, it appears sshd will crash on you when this is set. My guess is that since the X Window System is not built into OS X, sshd has a problem when it tries to do X Window stuff.

When this works properly, you shouldn't have to mess with the DISPLAY variable at all, since ssh will take care of it for you (usually will be localmachine:10 or a higher number, as that's how ssh intercepts it for forwarding).

I can't seem to find a way to encapsulate X Windows through ssh from OS X...as you say, going from another machine to OS X works fine.
 

robpatrick

Registered
Have you heard whether OS X 10.1 might help solve the problem of sshd crashing... or if there's another version of sshd for OS X that might work? Or another XWindows server (is that the right term? I mean, something besides Xfree86 to download that might run sshd appropriately, or a newer version of XFree86) that might work with Darwin's sshd?



-Rob
 

couzteau

Registered
this is february 2002.

the problem persists. setting x11forwarding to yes in sshd_conf should suffice, but doesn't work.

sshd still crashes immediately upon login unless you explicitly turn X11forwarding off using the -x option.

i was looking for a solution but reading this reassures me that i'm doing everything right, but the software doesn't work.

which part isn't working properly? would it make sense to get recompile and reinstall ssh?

ps:
messing around with DISPLAY, setenv and ip-addresses doesn't make sense, because if you set DISPLAY to a certain IP the xserver will try to establish a new tcp-connection instead of using the existing ssh connection.

as a matter of fact the display variable is never set, no matter how you log in. this has to solved but how?
 

blb

`'
The only way I've seen to make this work is to build your own OpenSSH set and use that as the sshd; it calls xauth properly and doesn't crash...

But then you either install it in a non-system location (what I've done) and accept that you can't use System Preferences to set it, or install in the system location and realize it'll be overwritten anytime Apple upgrades ssh.
 
Top