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
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.
Is the last command really necessary? Anyone can become root now, and so anyone can write to the sudoers file.
If you don not change back mode , sudo will not run as normal.
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?