Forwarded X with SSH

adamos42

New Member
I tryed start obs with X Forwarded SSH, but the result was this:
Code:
adamos42@a42book:~$ ssh -X 10.42.0.1
adamos42@10.42.0.1's password:
Welcome to Ubuntu 15.04 (GNU/Linux 3.19.0-28-generic x86_64)

* Documentation:  https://help.ubuntu.com/

You have mail.
Last login: Sat Sep 19 15:15:48 2015 from 10.42.0.109
adamos42@a42linux:~$ obs
X11 connection rejected because of wrong authentication.
QXcbConnection: Could not connect to display localhost:10.0
Félbeszakítva (core készült)
adamos42@a42linux:~$

It will be usefull if I can start obs on my laptop remoteley and with forwarded X the obs window will be on my laptop not on my pc (i can see the stream status, active scenes, sound levels)
 

adamos42

New Member
Maybe using -Y flag helps.

$ ssh -C -Y 10.42.0.1

Or read man page.

Result not changed:

Code:
adamos42@a42book:~$ ssh -C -Y 10.42.0.1
adamos42@10.42.0.1's password: 
Welcome to Ubuntu 15.04 (GNU/Linux 3.19.0-28-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

You have mail.
Last login: Sat Sep 19 23:03:35 2015 from 10.42.0.109
adamos42@a42linux:~$ obs
X11 connection rejected because of wrong authentication.
QXcbConnection: Could not connect to display localhost:10.0
Félbeszakítva (core készült)
 

adamos42

New Member
Code:
X11Forwarding yes

I'd appreciate if you not handle me as a beginner, the idea came to my mind because I had used the Forwarded X before. It worked with other programs, so the problem should be in the obs.

Nevertheless, if you have a workaround, i will try it. Somehow the obs should detect the console start and get the localhost display device, it die because the localhost:10.0 can't open and it's not a permission problem.

I tryed to export $DISPLAY too but im not successed, now the whole X forward not working somehow :/ I will repear it soon. Removing the .Xauthority file does not help eather for the authentication problem.
 

zenobs

Member
0. First check xauthentication state between the two.
1. First check whether .Xauthority is owned by you and has proper permissions.
2. Check whether X11 forwarding is enabled in your ssh client



PS: I avoided the command lines as you must be aware of the above two.
 

adamos42

New Member
1. First check whether .Xauthority is owned by you and has proper permissions.
2. Check whether X11 forwarding is enabled in your ssh client

PS: I avoided the command lines as you must be aware of the above two.

I did both of them, the 2. before starting the topic, 1. before posted the last post: #post-165990.
It works for you? Did you tried use obs with remote X before?
 

zenobs

Member
Yep. I just tried with two machines in my network just a while ago, fyi, and it works wonderfully.

Can you tell me exactly what you have done among the steps, including the commands? It would help the visitors here to understand exactly the problem and give relevant solutions.

PS. Over the forum, no one can assume the other, fyi.
 

adamos42

New Member
Okay then:

I have a PC with Ubuntu 15.04 where I use obs, this is my server (a42linux - 10.42.0.1). I have a laptop with Ubuntu 15.04 where I want to controll obs, this is my client (a42book - 10.42.0.109). The internet is plugged in on the a42linux ethernet and I make a hotspot with the internal TP-LINK wifi card for a42book.

First I installed full ssh on both machine:
Code:
sudo apt-get install -y ssh

Cheking the Forwarding on both machine:
Code:
grep X11Forwarding /etc/ssh/sshd_config

If the output is not:
Code:
X11Forwarding yes

then edit the file and enable the X11Forwarding
Code:
sudo echo "X11Forwarding yes" >> /etc/ssh/sshd_config
sudo service sshd restart

After that preparations I doed that:
Code:
adamos42@a42book:~$ ssh -X 10.42.0.1
adamos42@10.42.0.1's password: **********

[ssh connected]

adamos42@a42linux:~$ nautilus

Nautilus started without problem. I closed, after that I tried:
Code:
adamos42@a42linux:~$ obs

The result was:
Code:
X11 connection rejected because of wrong authentication.
QXcbConnection: Could not connect to display localhost:10.0
Félbeszakítva (core készült)

The "X11 connection rejected because of wrong authentication." and the "QXcbConnection: Could not connect to display localhost:10.0" is seperate problems I think, but maybe I not right.

I tried solve the "X11 connection rejected because of wrong authentication." problem:
Code:
adamos42@a42book:~$ sudo rm .Xauthority
adamos42@a42book:~$ touch .Xauthority

Code:
adamos42@a42linux:~$ sudo rm .Xauthority
adamos42@a42linux:~$ touch .Xauthority

I checked the permissions:
Code:
adamos42@a42linux:~$ ls -l .Xauthority 
-rw-rw-r-- 1 adamos42 adamos42 53 szept 20 09:07 .Xauthority

If I export DISPLAY on server then I can start programs on the server and it shows on the server monitor:
Code:
adamos42@a42linux:~$ export DISPLAY=:0.0

I think I just not get the right display for the task. I try use 10.42.0.109:0.0 as a display but not wokring. I added the client display to the xauth list, but still not working.
 

zenobs

Member
Meaning you have are yet to do everything. Do the following:

1. If you have not following two lines in your /etc/sshd/ssh_config (not sshd_config), append them.

Host *
ForwardX11 yes

Check if xauthentication works.



2. Else, do in your machine:

2A) Local machine:

$ xauth list $DISPLAY

You get something like:

machinename/unix:0 MIT-MAGIC-COOKIE-1 9184cm169759521c99d320c46057f6c7

2B) Remote machine

Add the cookies to the remote machine via ssh:
$ xauth add :0 MIT-MAGIC-COOKIE-1 9184cm169759521c99d320c46057f6c7

2B1) hen check if the machine name is not shown by:

$echo $DISPLAY

It should show you local machine name if that is authenticated.

Hope this helps.
 
Last edited:
Top