Solved Launch an X app with a different user

Hello :)

The final aim is to manage different Firefox sessions to improve "Private Browsing".
With this solution I would like to have different home and so different (and isolated) config for Firefox.

As user1 logged in a Mate session.
I want to launch another Firefox with user2.

Here is what I do (shell is csh) and what I get:
Code:
# su - user2
***pass***

# xhost +
xhost:  unable to open display ""

# setenv DISPLAY :0.0
# firefox
Error: cannot open display: :0.0

Anybody to help me ?
Thanks.
 
xhost is not the most secure program to use.
Why not use ssh. It allows you to pick what level of encryption you desire.

1) Make system browser users.

2) Edit /etc/ssh/sshd_config and uncomment the X11 forwarding settings.
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
Also set the path to xauth with this sshd_config setting:
XAuthLocation /usr/local/bin/xauth

3) Run your browsers like so:
ssh -XY xorg1@0 firefox
ssh -XY xorg2@0 firefox
ssh -XY xorg3@0 firefox
I am using xorg1, xorg2 and xorg3 as example user names here.
 
In case you want to use xhost nonetheless, here it is how:

user1: % xhost +
user1: % su - user2
password

user2: % setenv DISPLAY :0.0
user2: % firefox

If you want to seperate browsing sessions from eachother you can use Multi-Account Containers, a firefox add-on, instead of multiple browsers for that.

If you are concerned about security using a internet browser in general, this Thread 53362 might interest you.
 
Why not use ssh. [...]

Thanks Phishfry it works perfect!

In case you want to use xhost [...]

If you want to seperate browsing sessions from eachother you can use Multi-Account Containers, a firefox add-on, instead of multiple browsers for that.
xhost was what I tried to do first but I get errors as mentionned in the first post.

I prefer to have multiple Firefox sessions with different users to get the possibility to customize plugins and autorized websites.
 
Just a quick adding.

sshd was disabled on my FreeBSD.
Now enable.
PF do the job to exclude outside connections, but probably we can configure sshd as "only local" ?

My job; Find the corresponding thread to definitively complete this one :sssh:

EDIT :
Here what I have found (if someone can confirm it will be great).
In /etc/ssh/sshd_config simply edit/add AllowUsers config line. So simply.

Sample :
Code:
AllowUsers user2@localhost

is it correct to guarantee that sshd deamon is external safe with this ?
 
Back
Top