Run program with GUI and sound as a different user
I plan to reinstall my Linux distribution and apply some specific rules to improve security and keep some comfort at the same time. The plan is to create few users for specific aims:
user - main account with administrative privileges and access to all non-root folders; gamer - ordinary account with no administrative privileges and limited access to few shared folders like 'Music', 'Pictures', 'Videos' etc.; skype - ordinary account with access limited to dedicated subfolders to download and upload files; browser - ordinary account with access limited to dedicated subfolders to download and upload files; I want to work on user account and run browser as browser user with access only to 'Downloads' and 'Uploads' folders. The disadvantage will be that to send file through browser I will be forced to copy it to 'Uploads' folder first. I want to apply similar rules, but with more restrictions, to skype user. My concern is if it will be possible to share sound card and camera between profiles/users? Bit different situation is with gamer profile. I can switch user and run games on it. Gamer will also have limited access to folders like 'Music', 'Pictures', 'Videos' etc. Perfectly will be to run games on restricted gamer account being logged-in as user. WHAT I ALREADY DID I can easily share folders between profiles and create dedicated RAM disk. I also ran Firefox with some limitations (see below). FOR WHAT I NEED HELP I tried to run Skype as different user several times in the past, but with no success. Yesterday I spent literally whole day browsing the Internet and LinuxQuestions forum to find how to run Firefox as different user. What I figured out is that I need to use pkexec command. When I ran Code:
pkexec -u gamer firefox Code:
Error: no DISPLAY environment variable specified Code:
<?xml version="1.0" encoding="UTF-8"?> Code:
pkexec -u gamer firefox Code:
No protocol specified I ran Code:
sudo xhost local:test Code:
non-network local connections being added to access control list Code:
pkexec -u gamer firefox Code:
(firefox:27070): dconf-CRITICAL **: unable to create file '/home/gamer/.cache/dconf/user': Permission denied. dconf will not work properly. |
I found that I can also run Firefox as gamer simply by
Code:
sudo -Hu gamer firefox More details about using sudo to run graphical applications can be found in this thread: Why should users never use normal sudo to start graphical applications? |
Don't know if that was your issue, but on some systems you have to be in the audio group for sound to work.
Code:
sudo adduser gamer audio |
Dear Youen,
Thank you for suggestion. Unfortunately it does not work (at least not in Linux Mint). |
All times are GMT -5. The time now is 06:14 PM. |