6

$ xterm works on the client computer

In the client I have :

$ echo $DISPLAY
:0

in the config file in the server /etc/ssh/sshd_config:

X11Forwarding yes
X11DisplayOffset 10

trying to connect to the remote server:

$ssh -X user@host

@server01:/etc/ssh$ xterm &
[1] 4237
@server01:/etc/ssh$ xterm Xt error: Can't open display:
xterm: DISPLAY is not set
^C
[1]+ Exit 1 xterm
1
  • 1
    Does it work if you use -Y instead of -X?
    – zpletan
    Oct 24, 2011 at 11:53

2 Answers 2

1

X forwarding can be disabled on the server side. If the server is running OpenSSH, X11Fowarding must be explicitly set to yes in /etc/ssh/sshd_config. Unfortunately, if the option isn't set, there's nothing you can do other than running your own server or setting up a port forwarding manually with -R (if you do that, you don't benefit from automatic port allocation or xauth cookie handling).

4
  • I think is an authorization problem can you explain further the xauth cookie handling and how should it be set up properly in ubuntu 11.04. Thanks.
    – mancora
    Oct 25, 2011 at 9:36
  • @mancora When ssh does X11 forwarding, it takes care of the xauth cookies. Doing it manually is possible, just annoying. For a more general presentation of X cookies, read this answer. Oct 25, 2011 at 10:52
  • The problem is that I have everything properly configure in the server. I have the client and it can do a ssh -X user@server and open a ssh session. But this gives me can "can not open display" when I try to run xterm. From what I think it is a problem with Authorization something had been fault with the cookies I think.
    – mancora
    Oct 26, 2011 at 10:57
  • @mancora What does echo $DISPLAY show in the ssh session? Oct 26, 2011 at 13:52
0

In some posts, I read : "add AddressFamily inet to /etc/ssh/sshd_config", but don't work for my.

My problem was, I don't have lo interface. I solved added to /etc/network/interfaces file this lines

auto lo
iface lo inet loopback

You must log in to answer this question.

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