# Issue - X11 Forward not working on Freebsd Host and distant Linux client.



## Spartrekus (Jan 4, 2019)

Hello,

The topic is here about :

Issue - X11 Forward not working on Freebsd Host and distant Linux client.

The machine host (current keyboard, user) is the awesome, beautiful, 12 Freebsd, with i386, running Xorg icewm and fully operational.
Atheros ath0 is the wireless driver. From this machine, we login the distant Linux server:

ssh -C -X -p1022 the-linux-address-host-distant.org 

In, so now, command:
$ xterm 

missing DISPLAY.

Visibly there is a strange behavior.
So I try with KDE under Linux (same machine, instead of BSD, it is running Linux instead of FreeBSD), and I can see xterm (distant, with X11 forward over SSH). 
It works with Linux but it did not with freebsd.

On BSD there is:
Xorg -version
X.Org X Server 1.18.4
Release Date: 2016-07-19
X Protocol Version 11, Revision 0
Build Operating System: FreeBSD 12.0-RELEASE-p1 i386 
Current Operating System: FreeBSD  12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC i386
Build Date: 20 December 2018  09:20:53AM




I am looking forward for reading your comments, best sincerely regards


----------



## aragats (Jan 4, 2019)

Have you tried `ssh -C -Y ...`?
Also, what `$ echo $DISPLAY` on the remote machine shows?


----------



## SirDice (Jan 4, 2019)

By default the X server doesn't listen on a network socket on FreeBSD. You probably need to enable that too.


----------



## Spartrekus (Jan 4, 2019)

SirDice said:


> By default the X server doesn't listen on a network socket on FreeBSD. You probably need to enable that too.



Thank you ... I will look in this direction.

Actually, I belive that my PI with freebsd can do some X11 forward over ssh. I will check rc.conf and give you more news...... to be cont.


----------



## tingo (Jan 5, 2019)

aragats is correct, `ssh -Y` works.


----------



## Spartrekus (Jan 5, 2019)

it works!!

ssh -Y -C  ... works (on  BSD side).

Later, if more ssh connections on Linux, ssh -C -X ... does allow further X11 forward over SSH.

Thank you !!!!


----------



## Spartrekus (Jan 6, 2019)

actually, I get the following error message with the X11 forward. Any ideas would here greatly helpful.

```
$ xterm
X11 connection rejected because of wrong authentication.
xterm: Xt error: Can't open display: localhost:10.0
```


```
[spartrekus@desk01c ~]$ ssh -C -Y 192.168.1.11
The authenticity of host '192.168.1.11 (192.168.1.11)' can't be established.
ECDSA key fingerprint is SHA256:*****
No matching host key fingerprint found in DNS.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.11' (ECDSA) to the list of known hosts.
Password for spartrekus@:
Last login: Sat Jan  5 18:58:41 2019
FreeBSD 12.0-RELEASE r341666 GENERIC

Welcome to FreeBSD!

Release Notes, Errata: https://www.FreeBSD.org/releases/
Security Advisories:   https://www.FreeBSD.org/security/
FreeBSD Handbook:      https://www.FreeBSD.org/handbook/
FreeBSD FAQ:           https://www.FreeBSD.org/faq/
Questions List: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
FreeBSD Forums:        https://forums.FreeBSD.org/

Documents installed with the system are in the /usr/local/share/doc/freebsd/
directory, or can be installed later with:  pkg install en-freebsd-doc
For other languages, replace "en" with a language code like de or fr.

Show the version of FreeBSD installed:  freebsd-version ; uname -a
Please include that output and any error messages when posting questions.
Introduction to manual pages:  man man
FreeBSD directory layout:      man hier

Edit /etc/motd to change this login announcement.
/usr/local/bin/xauth:  file /home/spartrekus/.Xauthority does not exist
/usr/local/bin/xauth: (stdin):1:  bad display name "unix:10.0" in "remove" command
/usr/local/bin/xauth: (stdin):2:  bad display name "unix:10.0" in "add" command
$ xterm
X11 connection rejected because of wrong authentication.
xterm: Xt error: Can't open display: localhost:10.0
$
$
$
```


----------



## bart (Jan 6, 2019)

I've already encountered this kind of problem when I connect in ssh X in a jail. To solve this, you have to add the jail ip in /etc/hosts:

```
192.168.1.666 myhostname
```


----------



## Spartrekus (Jan 6, 2019)

It is from a raspberry.

The raspberry PI 3 b FreeBSD 13 starts : ssh -C -Y ...  on another FreeBSD i386 with 12.0 installed (xterm, Xorg, chrome,,...).


----------

