How to add SUDO access?
How do I give a regular user account sudo access?
I'm using CentOSv5 (essentially Red Hat Enterprise 5). THANKS! |
As "root", edit the /etc/sudoers file. Simple as that :)
Here's a bit more detail, should you wish to take advantage of other special features: http://www.centos.org/modules/newbb/...&viewmode=flat http://aplawrence.com/Basics/sudo.html |
Hi ;
Edit this file /etc/sudoers |
echo 'username ALL=(ALL) ALL' >> /etc/sudoers ##As root
|
Use visudo recommended way to edit /etc/sudoers
you should use "visudo" command which is the recommended way to edit /etc/sudoers . Examples are given inside the file so you can easily add users and give them rights to execute some/all commands as root.
Also you can enable log of commands executed via sudo. |
In addition to previous posters; make sure to BACKUP your sudoers file before making changes. Its good practice for any configuration file; and specifically to this one; making a mistake can result in you having to rescue the OS or even worse completely reinstalling.
|
Quote:
|
As have mentioned above, use visudo.
|
The reason for using visudo is that it will check the result of your edit before saving the file, and warn you if you've made a mistake. If you don't like vi, you can ensure visudo uses an editor of your choice by first using the command "EDITOR=nano" (or whatever).
|
change /etc/sudoers but make and verify a backup first.
|
I understand the advantages of using something like visudo, but is there any reason why I *should not* simply edit /etc/sudoers:
Quote:
Quote:
Also, when I execute "visudo" at the command line, all that happens is that /etc/sudoers opens in my text editor anyway... |
Read through your /etc/sudoers file and review the pam configuration for su and sudo if any. Also look through your installation manuals Security and Authentication section. E.g.: http://www.redhat.com/docs/en-US/Red...ment_Guide.pdf
It may be configured with both sudoers and pam such that you should add a user to the %wheel group. |
All times are GMT -5. The time now is 12:37 AM. |