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
James Henstridge
  • 40,476
  • 13
  • 109
  • 92
mancora
  • 61
  • 1
  • 3

2 Answers2

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

Gilles 'SO- stop being evil'
  • 59,745
  • 16
  • 131
  • 158
  • 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 09: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](http://unix.stackexchange.com/questions/10121/ssh-display-variable/10126#10126). – Gilles 'SO- stop being evil' 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 'SO- stop being evil' Oct 26 '11 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
juanpablo
  • 131
  • 1
  • 1
  • 4