# X-11 Forward with SSH br0ken

## bufobufo

Hello, 

i have little problem with my X-11 Forwarding and i dont have any ideas, where is the problem.

I am running cygwin with X-term on host machine. Output:

```

debug1: channel 0: new [client-session]

debug3: ssh_session2_open: channel_new: 0

debug2: channel 0: send open

debug1: Entering interactive session.

debug2: callback start

debug2: x11_get_proto: /usr/X11R6/bin/xauth -f /tmp/ssh-JljeMW8820/xauthfile generate :0.0 MIT-MAGIC-COOKIE-1 untrusted timeout 1200 2>/dev/null

debug2: x11_get_proto: /usr/X11R6/bin/xauth -f /tmp/ssh-JljeMW8820/xauthfile list :0.0 . 2>/dev/null

debug1: Requesting X11 forwarding with authentication spoofing.

debug2: channel 0: request x11-req confirm 0

debug2: client_session2_setup: id 0

debug2: channel 0: request pty-req confirm 0

debug3: tty_make_modes: ospeed 38400

debug3: tty_make_modes: ispeed 38400

debug3: tty_make_modes: 1 3

debug3: tty_make_modes: 2 28

debug3: tty_make_modes: 3 8

debug3: tty_make_modes: 4 21

debug3: tty_make_modes: 5 4

debug3: tty_make_modes: 6 0

debug3: tty_make_modes: 7 0

debug3: tty_make_modes: 8 17

debug3: tty_make_modes: 9 19

debug3: tty_make_modes: 10 26

debug3: tty_make_modes: 12 18

debug3: tty_make_modes: 13 23

debug3: tty_make_modes: 14 22

debug3: tty_make_modes: 18 15

debug3: tty_make_modes: 30 0

debug3: tty_make_modes: 31 0

debug3: tty_make_modes: 32 0

debug3: tty_make_modes: 33 0

debug3: tty_make_modes: 34 0

debug3: tty_make_modes: 35 0

debug3: tty_make_modes: 36 1

debug3: tty_make_modes: 37 0

debug3: tty_make_modes: 38 1

debug3: tty_make_modes: 39 0

debug3: tty_make_modes: 40 0

debug3: tty_make_modes: 41 0

debug3: tty_make_modes: 50 1

debug3: tty_make_modes: 51 1

debug3: tty_make_modes: 53 1

debug3: tty_make_modes: 54 1

debug3: tty_make_modes: 55 1

debug3: tty_make_modes: 56 0

debug3: tty_make_modes: 57 0

debug3: tty_make_modes: 58 0

debug3: tty_make_modes: 59 1

debug3: tty_make_modes: 60 1

debug3: tty_make_modes: 61 1

debug3: tty_make_modes: 70 1

debug3: tty_make_modes: 71 0

debug3: tty_make_modes: 72 1

debug3: tty_make_modes: 73 0

debug3: tty_make_modes: 74 0

debug3: tty_make_modes: 75 0

debug3: tty_make_modes: 90 1

debug3: tty_make_modes: 91 1

debug3: tty_make_modes: 92 0

debug3: tty_make_modes: 93 0

debug2: channel 0: request shell confirm 0

debug2: fd 3 setting TCP_NODELAY

debug2: callback done

debug2: channel 0: open confirm rwindow 0 rmax 32768

debug2: channel 0: rcvd adjust 131072

Last login: Sat May 27 22:42:02 2006 from 10.0.0.1

```

When i try to run gimp i receive following:

```

foo@bar ~ $ gimp

_X11TransSocketINETConnect() can't get address for localhost:6011: Name or service not known

GIMP could not initialize the graphical user interface.

Make sure a proper setup for your display environment exists.

```

and echo of $DISPLAY:

```

foo@bar ~ $ echo $DISPLAY

localhost:11.0

```

and my sshd_config on server, on which i connect to:

```

Port 22

PermitRootLogin no

IgnoreRhosts yes

X11Forwarding yes

TCPKeepAlive yes

ClientAliveInterval 43200

Subsystem       sftp    /usr/lib/misc/sftp-server

```

Do you have any ideas, what is wrong?

The $DISPLAY seems really strange, but i dont have any ideas, why it is setuped to 11.0

I have removed PAM following this tutorial: http://gentoo-wiki.com/HOWTO_Remove_PAM

Thx for any suggestions 

(and sry for my english)

----------

## Eskarel

Have you added the remote system to your xhost?

xhost +ip number

----------

## bufobufo

 *Eskarel wrote:*   

> Have you added the remote system to your xhost?
> 
> xhost +ip number

 

no, but now when i tried it, i have received:

```

Last login: Mon May 29 01:35:57 2006 from 10.0.0.1

foo@bar ~ $ xhost +

_X11TransSocketINETConnect() can't get address for localhost:6011: Name or service not known

xhost:  unable to open display "localhost:11.0"

foo@bar ~ $ export DISPLAY=:0.0

foo@bar ~ $ xhost +

Xlib: connection to ":0.0" refused by server

Xlib: No protocol specified

xhost:  unable to open display ":0.0

```

EDIT: i dont understand, why the DISPLAY is setuped to "localhost:11.0"

----------

## Jfr0

You started the Xserver on the cygwin machine ? I think you mihgt have to ssh -X from cygwin to get x forwarding to work.

----------

## bufobufo

 *Jfr0 wrote:*   

> You started the Xserver on the cygwin machine ? I think you mihgt have to ssh -X from cygwin to get x forwarding to work.

 

yes, offcourse.. i have an xterm started from cygwin, then i have ssh -XC to my home server, then i try to forward gimp

----------

## troymc

 *bufobufo wrote:*   

> 
> 
> no, but now when i tried it, i have received:
> 
> [code]
> ...

 

You need to run this command on your local machine before you log into the remote system.  It tells your local machine to accept X connections from other systems, otherwise your local system rejects the connection. 

 *bufobufo wrote:*   

> 
> 
> EDIT: i dont understand, why the DISPLAY is setuped to "localhost:11.0"
> 
> 

 

This is normal and is configurable on the X client (remote) side in the /etc/ssh/sshd_config file.  The variable is X11DisplayOffset and it defaults to 10. Each new session will increment that number.  :0.0 is the id of the first X session started on a box. This is normally the local GUI running on the machine.  SSH starts its sessions up at 10 so as not to interfere with these local sessions.

troymc

----------

## bufobufo

 *troymc wrote:*   

> 
> 
> You need to run this command on your local machine before you log into the remote system.  It tells your local machine to accept X connections from other systems, otherwise your local system rejects the connection. 
> 
> 

 

yes, i have tried too.. but no effect :-/ i still receive:

Make sure a proper setup for your display environment exists.

 *troymc wrote:*   

> 
> 
> This is normal and is configurable on the X client (remote) side in the /etc/ssh/sshd_config file.  The variable is X11DisplayOffset and it defaults to 10. Each new session will increment that number.  :0.0 is the id of the first X session started on a box. This is normally the local GUI running on the machine.  SSH starts its sessions up at 10 so as not to interfere with these local sessions.
> 
> troymc

 

thx for explanation

----------

## troymc

hmm....Ok, so try something like this:

```

local $ xhost +

access control disabled, clients can connect from any host

local $ ssh remote

Password: 

Last login: Tue May 30 21:25:22 2006

remote $ echo $DISPLAY

localhost:10.0

remote $ xterm &

[1] 28657

remote $

```

and a terminal window should open.

troymc

----------

## bufobufo

 *troymc wrote:*   

> hmm....Ok, so try something like this:
> 
> ```
> 
> local $ xhost +
> ...

 

Do you have a X-session running on remote?

When i tried this before (now i have X server broken in cygwin :-/ ), i have retrieving still the same error. The $DISPLAY was containing :

localhost:11.0

EDIT: on remote i have an x session running (its my home computer), so maybe this is the reason why the $DISPLAY contains the 11.0 instead of 10.0... but i am not sure, if its ok. I have fealing, that some months ago, the $DISPLAY was containing localhost:10.0 (when it worked)

P.S.: sorry for my english

----------

## Romeriz

Hello all,

I know this is very late  :Smile:  but it might help someone in the future. I had this issue and all it came down to was in my /etc/hosts file I did not have a localhost definition.

ie:

127.0.0.1         localhost

Hope this helps someone in the future.

Regards

Romeriz

----------

