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   
Comments:

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 11:13 AM 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 11:23 AM 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 01:47 PM CST #

If you don not change back mode , sudo will not run as normal.

Posted by william on August 22, 2007 at 03: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 03:44 PM CST #

Post a Comment:
Comments are closed for this entry.
About

williamxue

Search

Archives
« April 2015
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  
       
Today