LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to add SUDO access? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-add-sudo-access-819523/)

Arty Ziff 07-13-2010 12:22 AM

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!

paulsm4 07-13-2010 12:25 AM

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

subho.d 07-13-2010 01:30 AM

Hi ;
Edit this file /etc/sudoers

digsecurity 07-13-2010 01:34 AM

echo 'username ALL=(ALL) ALL' >> /etc/sudoers ##As root

omersattar 07-13-2010 03:58 AM

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.

alli_yas 07-13-2010 04:08 AM

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.

er.surendersharma 07-13-2010 07:37 AM

Quote:

Originally Posted by Arty Ziff (Post 4031511)
How do I give a regular user account sudo access?

I'm using CentOSv5 (essentially Red Hat Enterprise 5).

THANKS!

you should use "visudo" command which is the recommended way to edit /etc/sudoers .

RockDoctor 07-13-2010 12:58 PM

As have mentioned above, use visudo.

DavidMcCann 07-13-2010 05:27 PM

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).

smeezekitty 07-13-2010 06:05 PM

change /etc/sudoers but make and verify a backup first.

Arty Ziff 07-15-2010 12:26 AM

I understand the advantages of using something like visudo, but is there any reason why I *should not* simply edit /etc/sudoers:
Quote:

## Allow root to run any commands anywhere
root ALL=(ALL) ALL
to look like:
Quote:

## Allow root to run any commands anywhere
root ALL=(ALL) ALL
SomeUser ALL=(ALL) ALL
???

Also, when I execute "visudo" at the command line, all that happens is that /etc/sudoers opens in my text editor anyway...

jschiwal 07-15-2010 01:33 AM

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.