Aaditya Ura
Aaditya Ura

Reputation: 12679

user is not in the sudoers file. This incident will be reported in osx mac

hi i am using mac osx i tried to login sudo without password i followed this tutorial and edited this code in sudoers file

chmod +w /etc/sudoers
USERNAME ALL=(ALL) NOPASSWD: ALL
chmod -w /etc/sudoers

but now when i am trying to run any script with sudo command or trying to sudo -i its giving this error

user is not in the sudoers file.  This incident will be reported.

this only user am using means its root user and i tried this also

MacBook-Air:~ exepaul$ sudo chmod +w /etc/sudoers Password: exepaul is not in the sudoers file. This incident will be reported.

so please help me ;(

Upvotes: 0

Views: 7420

Answers (2)

Tianna DeSouza
Tianna DeSouza

Reputation: 1

Run these commands:

su root

nano /etc/sudoers

Then add the user below admin user like below syntax.

%admin ALL=(ALL) ALL

user_name ALL=(ALL) ALL

Upvotes: 0

vickey wu
vickey wu

Reputation: 9

for my instance , i just su root then enter self-define user password, then it switch to root!... then i change root password to new one

Upvotes: -1

Related Questions