3

I have had Ubuntu for a few months by now, and I have set up an administrator profile and a 'normal' account, which I use for everyday work.

Sometimes I need the admin profile, e.g. to install programs. This means that I have to switch profiles, execute whatever commands I need with sudo through the admin profile and then go back to work.

This is rather uncomfortable, as sometimes I have got open web pages with the instructions of what I have to do on my work profile.

Is there a way to use sudo with admin username/password while I am still logged in as 'work'?

Are there any other alternatives?

Braiam
  • 69,112

1 Answers1

2

The most convenient way is to use the terminal where you can launch programs with admin privileges. There are 2 options:

  1. You can add your normal user to the group of sudoers:

    sudo adduser normal-username sudo
    

    See Can I have a user execute sudo commands without being an administrator?

    Now you can execute commands in the terminal by writing sudo command

  2. Use your admin profile:
    To use your admin profile in the terminal, you can su to that user, like su admin-username and then enter the admin user's password. If this doesn't work for the programs you want to run (it won't work for graphical applications), see this question:

    How can I run an application with a GUI as admin from a non-admin user session?

Zanna
  • 72,312
smiddy84
  • 493