Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Situation: I'm running OS X 10.8.3 and i have 2 users, an Admin user and a Standard user. When i'm logged in as the standard user and i need to run a command with admin privileges in the terminal i use:

    su myadmin
    <enter the password>
    sudo bash
    <enter the same password... again>
    easy_install etc  (run the priveleged command)

Question: Can i do all of this in just 1 single terminal command, and only having to enter the admin password 1 time?

EDIT: fyi so far i found this, it's 1 command but it still requires me to enter the same password 2 times:

su myadmin -c 'sudo easy_install etc'
share|improve this question

If you are comfortable editing the sudoers file (/etc/sudoers), you can add a line like:


It will give USERNAME the ability to sudo as root directly.

So, to do the above, you would just type:

sudo easy_install etc

Note that you would enter the password for USERNAME after the sudo command, and not the admin password. If you have set up your standard user account without a password, then this probably will not work

share|improve this answer
Okay thanks for your answer. That would kind of defeat the purpose of using a 'standard' account instead of an 'admin' account. I'd rather not give my standard user account additional permissions. – Daps0l May 24 '13 at 12:06
Almost... as far as I know, the GUI layer of OSX would still require you to put the actual admin username and password in before running installers, etc. It uses the unix group membership, and not sudoers. – Kent May 24 '13 at 21:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .