How to edit "sudoers" file using visudo
Hey everyone. I am somewhat newer to linux, and i do not know how to edit my sudoers file so that my non-root user account can use tools such as wifi-radar.
On Slack Builds it says what to do, but every time i try and follow what is says, i have no luck because i don't know where to put this line: %users ALL = NOPASSWD: /usr/sbin/wifi-radar Here's the link: http://slackbuilds.org/repository/12...rk/wifi-radar/ Anyway i would like to add my other user account so that it has full sudo privileges similar to root. anyone know how? I checked the Sudoers man page, but i seem to be somewhat linux-illiterate and didn't find any solutions... thanks, matt. p.s. sorry if it confusing, it is past my bed time.. good night. |
Please think about what you're asking for very carefuly... if you
do what you intend any flawed application that you run can potentially damage your system with that mechanism w/o needing a password. More specifically that line would give every user account the ability and the right to damage the system. Cheers, Tink |
hmmm, let me put it this way... The biggest problem that i have is that i want to be able to use my network managers (wifi-radar and wlassistant) and as of now the only way i can access them is if i am logged in as root.
How yould i be able to access these two tools not logged in as root (becasue both require sudo to run)? -matt |
There should be a line like: root ALL=(ALL) ALL. You can simply create a second line like that but replacing "root" with your username.
Alternatively, you can use %admin ALL=(ALL) ALL In that case, however, you'll have to add yourself to the admin group (/etc/groups). |
Quote:
matthew ALL=(ALL) ALL or %admin ALL=(ALL) ALL is there any specific spacing or anything...because i am pretty sure i tried that.. :( hmm:$ |
Nope ... those should work just like that. Does visudo complain
when you try to save the file? It performs a syntax check on it, and if it fails sanity it warns you. That said: while "(ALL) ALL " without the NOPASSWD is a more sane set-up you could also add a NOPASSWD: /path/to/special/file for those two tools, and use "su - " for other (less frequent) tasks... Cheers, Tink |
this may sound stupid... but what is the correct way to save visudo after you edit it?
do i run visudo again? -matt yes, i know i am a newbie...but you gotta start somewhere. |
I don't know, in what editor is it opened? If it is in VIM, you simply use ESC :wq to save it. In nano, it would be ctrl+o ctrl+x.
|
you can change the editor visudo uses by typing
EDITOR=nano you can also change it back to vi or vim like this EDITOR=vi I recommend the nano or pico editor for you because they are easy to use i use the all the time myself they make sure you type username ALL ALL=(ALL) ALL in ALL caps! :-) except for you user name of course :-) |
Actually, in vi(m) it's
esc :x x= save changes & exit w= write q= quit of course wq has the same effect as x .... |
I actually use the easiest way to save and exit in vi(m)
It is ZZ The keys you press are right next to each other. Three different ways to do the exact same thing. haha |
Being a day 2 new user to CentOS 6.4, I ran into the same challenge of not haivng my user account in the sudoers file. I read this forum post, and found this great tutorial http://www.garron.me/en/linux/visudo...lt-editor.html
This worked for me! |
All times are GMT -5. The time now is 08:39 PM. |