X11 Forwarding problem in Ubuntu server 10.04 LTS

It’s my first ubuntu server i tried to install , version used : 10.04 LTS . But the X11 Forwarding does not work for me in this linux variant. I am using Xming , putty (information on configuring putty with xming for X11 Forwarding , read this blog) and also SSH Secure client in my Windows 7 to do X11 Forwarding from all my managed Fedora, Solaris and CentOS workstations , all works , except this newly installed ubuntu server. The error message is :

> xclock
Error: Can’t open display:

Here the Display variable is empty !! The Display variable ought to be localhost:10.0

When I read /var/log/auth.log , it says :

Jan 23 20:43:30 sshd[8457]: error: Failed to allocate internet-domain X11 display socket.

blah…. blah… blah …

After googling for some hours , it turns out there is a bug in ubuntu server’s sshd to mess up with ipv6 network interface. In my case , I have disabled using ipv6 in Ubuntu (steps)already , but that still bothers with sshd behaviour . So the fix is deliberately define **only** listen to ipv4 network interface in /etc/ssh/ssh_config , in order to rectify the behaviour of sshd.

/etc/ssh/sshd_config :

AddressFamily inet
Port 22

** Special note here : you must define the line “AddressFamily inet ” before the line of “Listen Address ” .

After changing this setting , rebooting the server ( In my case restarting sshd through “/etc/init.d/ssh restart ” does not work !!) , and then X11 Forwarding will work for me !

You may also like...

Switch to our mobile site