On using the sudo command if we see the error
This means that the user as whom we have logged in and are trying to run the command "sudo" does not have the permission to do so.
Only the users listed in /etc/sudoers have the permission to use the command "sudo".
To give the sudo permission to a user we need to add the user to the file /etc/sudoers file.
Open the file /etc/sudoers as root.
Add the line
under the User privilege specification section.
Save the file and exit, now the sudo command should work for the user which was added in the file.
This means that the user as whom we have logged in and are trying to run the command "sudo" does not have the permission to do so.
Only the users listed in /etc/sudoers have the permission to use the command "sudo".
To give the sudo permission to a user we need to add the user to the file /etc/sudoers file.
Open the file /etc/sudoers as root.
Add the line
under the User privilege specification section.
Save the file and exit, now the sudo command should work for the user which was added in the file.
So you need to run vi as root to be able to run programs as root... interesting.
ReplyDeleteOr as any user with admin privileges so that not every one gets access to complete system.
DeleteAt my system I could access the root account by typing "su root" in the command-line. This will login the root, and works fine for me, but of course "sudo" is much better ;)
ReplyDeleteWell su is also a good option, you don't have to type "su root" . just "su" will also login as root.
DeleteHAVE THE SAME problem, help, ok, I open sudoers file with usr/sbin/visudo ,or with sudo vi /etc/sudoers, doest matter,I know that I should change root ALL = (ALL) ALL TO username ALL = (ALL) ALL, BUT:
ReplyDeleteHOW THE HELL SAVE THIS THING? CTRL + X doesnt work.
try sudo -i to login into root then open the sudoers file. It might work.
DeleteI am getting the same error ,when I write the sudo -i or sudo root,it shows [sudo] password for Dave (My username): and then I see Dave is not in the sudoers file. This incident will be reported.
ReplyDeleteI use Oracle Linux
Were you able to add your username to sudoers file ?
Deletenope. having the same problem as above - very odd... had it and then lost it. root, that is.
ReplyDeleteWHOA!! Thats dangerous! Use the % and assign yourself to the group using groupadd or gnome-user-management panel..which for gnome3 needs to be installed via aptitude, synaptic, or via apt-get.Reboot to fix.
ReplyDeleteThank you for the information :-)
Deleteuse su - to open a root console. Yall are doing it wrong.
ReplyDeleteThat too would require the root password..
DeleteRichard, what are the proper steps?
ReplyDeleteMy main account is named "capacitor" and I have a temporary account named "tempuser" that I am trying to assign all privileges to.
In the end I am trying to change the User ID number so that it is the same number as my mac user files (501) and I can seemingly only change the ID of capacitor if I am logged in as someone else, in this case "tempuser"
Linux Mint 14 x64:
ReplyDeletesu -
chmod u+rw /etc/sudoers
vi /etc/sudoers
add ALL = (ALL) ALL
:x
chmod u-w /etc/sudoers
Voila!
Thanks Anonymous! That worked for me.
ReplyDeleteglad it helped :-)
DeleteHey Read this Link hope it will help as it works for me :)
ReplyDeletehttp://www.broexperts.com/2013/03/username-is-not-in-the-sudoeur-name/
I do not see any difference in what is there in that link an this one. post......
DeleteI think use the following command is better and safe
ReplyDeleteswitch to root and then command:
usermod -a -G wheel someusername
haven't tried that, but should work . Thanks for the info :-)
Delete