How to run application under different user

7,144

Solution 1

You could try gksu -u rather than gksudo. 'gksudo' implies the need for an 'administative' password.
'gksu' is 'switch user' and will ask for User2's password.
You'll probably run into permissions issues since the displayed desktop belongs to User1.

Solution 2

Disclaimer - I am just answering the question of how to make the configuration change you are wanting, not advocating that you do this, I would highly advise you stay with the defaults and use the user password (an not the target password as outlined below).

It seems the question has morphed to how to configure sudo / gksu / gksudo to use the second users password.

This part of the question is done by configuring sudo.

sudo visudo

Look for the "Defaults" section (there are several Default lines already)

Add in a line

Defaults runaspw

This will configure sudo to ask for the user password. The problem with this is that you will have to first set a root password as sudo will ask you for the root password to run commands.

See http://www.gratisoft.us/sudo/sudoers.man.html for details

Share:
7,144

Related videos on Youtube

jaseelder
Author by

jaseelder

Updated on September 18, 2022

Comments

  • jaseelder
    jaseelder almost 2 years

    I am using 11.04. I have two users. (User1 and User2).

    Could you please tell if it is possible to run Firefox or any other browser with another User's profile.

    Let say, I am using User2 to access my office network via browser. So while working on User1, I want to access office network and dont want to switch from User1. So will it be possible to change few permissions so as to make firefox open only using User2's profile.

    So scene would be something like this. 1) User1 clicks on firefox launcher 2) OS asks for User2's password 3) User1 enters User2's password 4) Firefox is launched with User2's profile. (It loads all configurations from ~/home/user2/.firefox)

    • jaseelder
      jaseelder over 12 years
      One solution is to use gksudo -u <user2> <command>. But this asks for sudo password where as I want to use user2's password
    • danjjl
      danjjl over 12 years
      Isn't this a duplicate of askubuntu.com/q/5410/22537 ?
    • jaseelder
      jaseelder over 12 years
      @danjjl As mentioned, i know gksudo approach. The problem is it asks for my password or admin password where as I want to run app with user2's password. Is that possible?
  • jaseelder
    jaseelder over 12 years
    I want to access my office network from safe environment. So my thinking is, if I could launch firefox and make him use user2's configuration then all the cookies or anything that is harmful will not affect when I am running under user2.
  • Klau3
    Klau3 over 12 years
    Okay, all you want is two different user profiles. When starting Firefox with 'firefox -ProfileManager' it lets you create a new user profiles and choose between them.
  • Argusvision
    Argusvision over 12 years
    Oops. Just saw the profile manager bit.