0

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)
    exit
    exit

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'

1 Answer 1

1

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

USERNAMEALL=(ALL) ALL

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

2
  • 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.
    – Motsel
    May 24, 2013 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, 2013 at 21:53

You must log in to answer this question.

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