You are not logged in.

#1 2015-08-01 21:54:48

donttrust
Member
Registered: 2015-08-01
Posts: 3

Running a GUI application using another account

I am using Awesome WM. I am forced to use a piece of proprietary software which I don't trust very much. I would like it not to have access to my personal files so I set up another user account (using useradd), switched to that user (using su) and tried to execute the application from the shell. It says it can't connect to the X Server. What are my options?

Last edited by donttrust (2015-08-01 21:55:48)

Offline

#2 2015-08-01 21:57:33

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Running a GUI application using another account

Log in as that special user, start X and run the application.

Offline

#3 2015-08-01 21:59:02

donttrust
Member
Registered: 2015-08-01
Posts: 3

Re: Running a GUI application using another account

karol wrote:

Log in as that special user, start X and run the application.

Thanks for quick reply, I need to be logged in my main account (for using other things) while I'm working in the proprietary software , are you suggesting running two separate X sessions in different TTYs?

Last edited by donttrust (2015-08-01 22:01:02)

Offline

#4 2015-08-01 22:06:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Running a GUI application using another account

donttrust wrote:

are you suggesting running two separate X sessions in different TTYs?

Yup.
Let's see if this works.

Offline

#5 2015-08-01 22:20:07

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,543
Website

Re: Running a GUI application using another account

You could also use a VM or a LXC container which would be even more secure than just a separate user - and either of these could run right next to your other programs so you wouldn't need to change back and forth between vts.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2015-08-01 22:25:06

donttrust
Member
Registered: 2015-08-01
Posts: 3

Re: Running a GUI application using another account

karol wrote:
donttrust wrote:

are you suggesting running two separate X sessions in different TTYs?

Yup.
Let's see if this works.

It works, thanks.

It's not very comfortable though. For example, I'll miss my new email notifications in my main X session while I'm working in the second one. Can anybody suggest other options? Like running the application in some kind of chroot/jail/cgroups/container? And I don't want to run a VM, it'll be an overkill.

P.S.
I'm new to Linux, please forgive me if I've written something silly.

---

Edit:

@Trilby
You posted while I was writing my post. LXC containers? Thanks, it sounds like it's what I need. Is it being used for security isolation? Can you point me to some tutorial where they tell how to run a GUI application in LXC container?

---

Edit 2:

Well, it seems the mighty Arch Wiki covers this:

https://wiki.archlinux.org/index.php/Li … g_programs

Last edited by donttrust (2015-08-01 22:37:40)

Offline

#7 2015-08-02 02:05:39

sonoran
Member
From: sonoran desert
Registered: 2009-01-12
Posts: 192

Re: Running a GUI application using another account

You can temporarily disable your X server's access controls with the xhost command:
https://wiki.archlinux.org/index.php/Xhost

Then su to your second user and run the proprietary software.

EDIT:
Use "su -" instead of "su" so that the second user logs into his own home and his own environment.

[user1 ~]$ xhost +
[user1 ~]$ su - user2
[user2 ~]$ <run proprietary program>
[user2 ~]$ exit
[user1 ~}$ xhost -

Last edited by sonoran (2015-08-02 12:42:10)

Offline

Board footer

Powered by FluxBB