Ask Different is a question and answer site for power users of Apple hardware and software. 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

I added

"Syammala Naidu" ALL=(ALL) ALL

to /etc/sudoers, rebooted and logged in as Syammala Naidu and run sudo -i. Sudo tells me: user not in sudoers file, incident Reported.

How can I fix this?

share|improve this question
2  
xkcd.com/838 – CousinCocaine Jun 10 '15 at 6:23
    
is this an answer @CousinCocaine – Phani Naidu Jun 10 '15 at 6:31
up vote 3 down vote accepted

sudo exclusively uses account names, not the user's full name. As a hint, account names don't contain spaces, so "Syammala Naidu" is not correct.

To find out a user's account name:

  1. Open System Preferences.
  2. Select Users & Groups.
  3. If necessary, click the lock on the bottom left corner of the window and type an administrator's name and password to unlock the preference pane.
  4. Right-click the account and select Advanced Options....
  5. Locate the Account name property:

    enter image description here

    Use that account name in /etc/sudoers. To edit the file, use visudo. For more information, check man visudo and man sudoers.

share|improve this answer
1  
Or look at the name of the home folder, the account name is the part after /Users/ :-) – patrix Jun 10 '15 at 7:06
    
Thanks for ur help – Phani Naidu Jun 11 '15 at 7:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.