1

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

2 Answers 2

4

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
1
  • Hmm.. Creative! That works for me :)
    – Earlz
    Jan 23, 2012 at 20:47
2

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.

1
  • 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. Jan 24, 2012 at 11:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .