How to solve "is not in the sudoers file" ? (如何解决"is not in the sudoers file")
When you use "sudo" command in Solaris, if you encounter the problem "UserName is not in the sudoers file" , here is a solution about it:
- become root : su -
- chmod +w /opt/csw/etc/sudoers
- add
UserName ALL=(ALL) ALL
into last line of /opt/csw/etc/sudoers
- chmod -w /opt/csw/etc/sudoers








Why don't you use
/opt/sfw/sbin/visudo
instead of chmod +w and chmod -w?
Sven
Posted by Sven on August 22, 2007 at 06:13 PM CST #
Sven, good suggestion, thank you!
This problem is in SNV 70, you can see my next bloghttp://blogs.sun.com/weixue/entry/using_snv70_installer_why_sudo.
Posted by xue on August 22, 2007 at 06:23 PM CST #
Is the last command really necessary? Anyone can become root now, and so anyone can write to the sudoers file.
Posted by SwitchBL8 on August 22, 2007 at 08:47 PM CST #
If you don not change back mode , sudo will not run as normal.
Posted by william on August 22, 2007 at 10:00 PM CST #
i just installed mint and somehow my name got removed from the sudoers file.. now i dont have admin or root permissions...
anyone know how to sort this?
Posted by gijoe on November 03, 2009 at 11:44 PM CST #