I'm new to SSH and trying to setup a connection to run Xapplications through my school. I made the login perfectly fine but once inside, i export the display to my ip ie:

export DISPLAY=MYIP:0.0

After that i try to run serveral xapplications for example xterm or firefox, though nothing happens. Instead of telling me that it cant reach the display or similar, I get no responce from the terminal, i have to ctrl + C to get back to the prompt.

I get the feeling I'm missing something simple..


If you're setting DISPLAY then you're overriding ssh's X11 forwarding; ssh sets DISPLAY properly itself with the -X or -Y option (you probably want the latter).

Once you connect, run echo $DISPLAY , you should see 10:0

Beyond that, your attempt to connect X11 directly (don't do that; it's extremely insecure) is likely being dropped by a firewall.

Also, if you are wanting to tunnel http traffic, rather then forwarding firefox, it is better to use port forwarding, ie a socks proxy.

ssh -C2qTnN -D 8080 username@server

See: https://calomel.org/firefox_ssh_proxy.html

  • If I don't set the display, it tells me "cant open display, display is not set". So how should I not connect to X11 directly? I'm entering ssh -x login@host. – Mikael Apr 8 '12 at 13:30
  • ssh is case sensitive. -X or -Y (you want -Y as I already told you) turns on X11 forwarding. -x as you gave it turns it off. – geekosaur Apr 8 '12 at 13:53
  • Very good, thank you guys! Case sensitivity can be a bitch (when you don't know about it). It now works perfectly fine! – Mikael Apr 8 '12 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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