Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to mark my browser internet traffic with a DSCP by selecting the packages with a certain owner. In order to do that I have to start my browser with a dummy user.

I start my browser by binding a terminal command to a keyboard shortcut. So for now that has always been chromium-browser.

The steps I have taken so far:

Create a new user:

 sudo useradd <dummy user>
 sudo passwd <dummy user>
 sudo mkdir /home/<dummy user>
 sudo chown <dummy user> /home/<dummy user>
 sudo chgrp <dummy user> /home/<dummy user>

Allow the new user to acces X

xhost +

Run the command as the new user

I start a terminal as the original user (non-root) and run the following command:

su <dummy user> -c chromium-browser

after typing the dummy user password I can run the chromium-browser as the dummy user. Chromium will be all new and won't have any of my old settings since it uses the newly created dummy user home dir.

Now I don't want to have to enter a password at any stage so I looked into how to work with the sudoers file.

Apperently it is possible to run a command as another user without being prompt for the password by changing the sudoers file. I have not yet figured out exactly how but I think it relies on sudo -u. Which also allows you to run a command as someone else. Before I started to adapt the sudoers file I wanted to test this structure. So I ran:

sudo -u <dummy user> chromium-browser

And I got the following error:

[0906/012127:ERROR:nss_util.cc(90)] Failed to create /home/<user>/.pki/nssdb directory.
[0906/012127:ERROR:nss_util.cc(90)] Failed to create /home/<user>/.pki/nssdb directory.
Home directory /home/<user> not ours.

where <user> is my username. So it tries to acces my home users home dir.

I'm hoping someone can help me figure this out. I have the feeling I'm sort of in the right direction but I need someone let me see what I'm doing wrong. Also any help on how to change the sudoers file would be appreciated.

Thanks in advance!

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.