Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 3 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
share|improve this answer
    
Hmm.. Creative! That works for me :) –  Earlz Jan 23 '12 at 20:47

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.

share|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 '12 at 11:02
    
Thanks, edited acccordingly. –  Wyzard Jan 24 '12 at 14:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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