1

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
  • 67,791
  • 32
  • 179
  • 269

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
  • 70,465
smiddy84
  • 493
  • 1
  • 6
  • 14
  • Hey, that's great! Thanks, it's just what I was looking for: open terminal --> su --> insert password --> do what you need to do! Have a nice day, Max – user209562 Oct 30 '13 at 15:36
  • Adding a user to the sudoers group makes him theoretically already an admin user... :-/ That is probably not intended. – Byte Commander Aug 06 '15 at 11:30