Sudoers list
It would be a great help if someone help me to add my user in sudoers list. I have already created user using adduser command.
|
You need to edit your sudoers file in the appropriate way. You can find one explanation here. A quick search on the web will find you plenty of other explanations. You'll need to use visudo to do the job.
jdk |
My preferred option is to use a group for this:
Code:
/usr/sbin/groupadd mysudoers Code:
/usr/sbin/usermod -a -G mysudoers username Code:
%mysudoers ALL=(ALL) ALL Note that in this example the user will be able to execute ALL commands but will have to use their password to execute them. |
How to add line with visudo
I tried to edit visudo using text editor like mc but failed. The output of
/usr/sbin/visudo only displays the contents |
running visudo lets you edit the file with "vi" commands, go read up on man visudo
|
Don't edit the file using visudo... You need to learn about vi and I remember my first passes at vi... I broke the script I tried to edit :P
use one of these commands (as root): Code:
mcedit /etc/sudoers Just make sure you understand what you need to add and don't go for the no password option... P.S. Just in case you are curious what's all the fuss about vi/vim.. type Code:
vimtutor |
nano is my favourite simple editor.
|
Quote:
|
You can use any editor you like with visudo using the EDITOR environment variable, e.g.:
Code:
EDITOR=nano visudo |
Just typing visudo as root takes you directly to /etc/sudoers at 1 time in debian it was almost like using vim but now when I use it the interface is almost the sam as nano.
|
Hi,
Quote:
Evo2. |
So doing the following
Quote:
Code:
sudo visudo |
nano /etc/sudoers
or add yourself to the wheel group and uncomment wheel |
Hi,
Quote:
Quote:
Please be careful when offering advice. Evo2. |
@evo: I actually never knew (or never took to much care to notice) that the EDITOR variable existed.. Thanks..
|
All times are GMT -5. The time now is 10:14 PM. |