Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

$ 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
share|improve this question
1  
Does it work if you use -Y instead of -X? –  zpletan Oct 24 '11 at 11:53

2 Answers 2

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).

share|improve this answer
    
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 '11 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. –  Gilles Oct 25 '11 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 '11 at 10:57
    
@mancora What does echo $DISPLAY show in the ssh session? –  Gilles Oct 26 '11 at 13:52

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
share|improve this answer

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.