I'm trying to run an X program on my home computer from my work computer. The basic setup is this:

Arch Linux work computer -> OpenBSD SSH router(at home) -> Arch Linux home computer(with SSH)

I've never actually tried to do this and I'm not quite sure how to. How would I get this to work?

When I just try doing

$(work computer) ssh -Y home-ip
..
$(home router) ssh -Y private-ip

I get on the last tunnel "X11 forwarding request failed on channel 0"

How do I do this properly?

EDIT: I forgot to enable X forwarding on the sshd of my home computer. I've fixed that now, but nothing seems to happen when I do a simple command like xterm. It just sits there, presumably trying to display the xterm window on my router and not on my work computer

link|improve this question

64% accept rate
feedback

2 Answers

up vote 2 down vote accepted

How about forwarding a port on your work computer to your home computer's port 22 and then ssh -Y to that local port?

For example,

ssh -L 2222:private-ip:22 router-ip
ssh -Y localhost:2222
link|improve this answer
Hmm.. Creative! That works for me :) – Earlz Jan 23 at 20:47
feedback

What you've done should work, but you need to have the xauth program installed on the router so that it can create a security key for the virtual X11 display that SSH creates. You need xauth on any machine that you ssh -X or ssh -Y to, even if you don't actually run any X applications there, but just use it as a step toward somewhere else.

After you've connected to the home computer, check your $DISPLAY variable. It should be something like localhost:10. If not, go back to your shell on the router and check $DISPLAY there.

link|improve this answer
Not from, but to. The ssh client doesn't need to modify xauth data in any way. The server needs to create a temporary .Xauthority file. – grawity Jan 24 at 11:02
Thanks, edited acccordingly. – Wyzard Jan 24 at 14:49
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.