Reputation: 12679
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
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
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