Add user to sudoers on Mac OS X

14 Apr 2014

To allow user to perform sudo command on Mac OS X, simply follow next steps…

  1. Login as administrator: su adminusername
  2. Edit sudoers file with vim /etc/sudoers
  3. Find following line: %admin ALL=(ALL) ALL (in vim you can type: /%admin ALL=(ALL) ALL)
  4. Add your user to the list of sudoers as follows: username ALL=(ALL) ALL (in vim, you should press “i” on keyboard to switch to insert mode)
  5. Press ESC to exit insert mode and type :wq (to write file and quit application)

Now, you are be able to perform sudo command under your Mac OS X with desired username.

Have a productive day!

  • Was this helpful?
  • Yes   No
  • Back