Mailing List Archive

problem with X11Forwarding
Hi,
I have enabled X11Forwarding in sshd_config

mahmood@server:~$ cat /etc/ssh/sshd_config | grep "X11*"
X11Forwarding yes
X11DisplayOffset 10


However when I connect through "ssh -X server_ip" and run "xclock" I get this error:

 mahmood@server:~$ xclock
Error: Can't open display:


Any way to fix that?
// Naderan *Mahmood;
Re: problem with X11Forwarding [ In reply to ]
Hi,

If you are on same machine then try two following commands:

$ export DISPLAY=localhost:0.0
$ xhost localhost

I hope this will solve issue.
Re: problem with X11Forwarding [ In reply to ]
Is the ssh client configured to forward X11 too?



On Mon, May 23, 2011 at 3:35 AM, Mahmood Naderan <nt_mahmood@yahoo.com> wrote:
> Hi,
> I have enabled X11Forwarding in sshd_config
>
> mahmood@server:~$ cat /etc/ssh/sshd_config | grep "X11*"
> X11Forwarding yes
> X11DisplayOffset 10
>
>
> However when I connect through "ssh -X server_ip" and run "xclock" I get this error:
>
>  mahmood@server:~$ xclock
> Error: Can't open display:
>
>
> Any way to fix that?
> // Naderan *Mahmood;
>
Re: problem with X11Forwarding [ In reply to ]
On 05/23/2011 04:35 AM, Mahmood Naderan wrote:
> mahmood@server:~$ xclock
> Error: Can't open display:

Sounds to me like you need to do 'xhost +127.0.0.1' on the machine you're
initiating your ssh connection from or you need to use 'ssh -Y server'.

John
Re: problem with X11Forwarding [ In reply to ]
On Mon, May 23, 2011 at 4:35 AM, Mahmood Naderan <nt_mahmood@yahoo.com> wrote:
> Hi,
> I have enabled X11Forwarding in sshd_config
>
> mahmood@server:~$ cat /etc/ssh/sshd_config | grep "X11*"
> X11Forwarding yes
> X11DisplayOffset 10
>
>
> However when I connect through "ssh -X server_ip" and run "xclock" I get this error:
>
>  mahmood@server:~$ xclock
> Error: Can't open display:

does the xterm work on the server where you are running the `ssh -X ..' ?


>
>
> Any way to fix that?
> // Naderan *Mahmood;
>



--
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
Re: problem with X11Forwarding [ In reply to ]
 
Dear all,

Thanks for your replies. However I don't know why I didn't received many replies on time. For example today I saw that many replies were sent 2-3 days days ago and now I am reading them!!


I think the problem is with mailing list. anyway....


After I turned on the sshd in debug mode (-ddd) and connect from a host, I see this:


debug1: session_input_channel_req: session 0 req x11-req
debug2: bind port 6010: Cannot assign requested address
debug2: bind port 6011: Cannot assign requested address
debug2: bind port 6012: Cannot assign requested address
debug2: bind port 6013: Cannot assign requested address

After some search I found this topic
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=422327

In the last reply, it is stated that

1) Adding the following to your sshd_config
AddressFamily inet
2) Restart SSH

I did that exactly and now I can forward X. The problem has been solved.
hope this help others too

 

// Naderan *Mahmood;



----- Original Message -----
From: Darryl Cook <dlc@cs.appstate.edu>
To: Mahmood Naderan <nt_mahmood@yahoo.com>
Cc:
Sent: Friday, May 27, 2011 7:23 PM
Subject: Re: problem with X11Forwarding

make sure you enable it in ssh_config as well.  that controls your ssh sessions.

Quoting Mahmood Naderan:

> Hi,
> I have enabled X11Forwarding in sshd_config
>
> mahmood@server:~$ cat /etc/ssh/sshd_config | grep "X11*"
> X11Forwarding yes
> X11DisplayOffset 10
>
>
> However when I connect through "ssh -X server_ip" and run "xclock" I get this error:
>
>  mahmood@server:~$ xclock
> Error: Can't open display:
>
>
> Any way to fix that?
> // Naderan *Mahmood;
>



--Darryl Cook
Systems Administrator - Computer Science
Appalachian State University
Boone, NC 28607
828-262-2296

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.