Linux :how to provide sudo access to the user

Linux OS:

please advice the steps required to provide the sudo access to the user.
mac_gAdmin - Middleware ServersAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David AtkinTechnical DirectorCommented:
Hello,

There is an excellent article on how to do this here:
https://www.digitalocean.com/community/tutorials/how-to-add-delete-and-grant-sudo-privileges-to-users-on-a-debian-vps

Basically you need to login as the root user (or with root permissions) and add the user to the sudo user list:

sudo visudo
omarfaridCommented:
please see link below for examples, as root you can provide required priv to run certain commands to certain users:

https://www.sudo.ws/man/1.8.17/sudoers.man.html
rindiCommented:
Normally it is better to use groups of which the allowed users are members of rather than add every user to the sudoers file.

But otherwise it is the same, just edit that file.
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

mac_gAdmin - Middleware ServersAuthor Commented:
Can you please provide the steps ?
David SankovskySenior SysAdminCommented:
There are several ways to do this and they change based on the distro you are using.
What distro are you working on?
mac_gAdmin - Middleware ServersAuthor Commented:
Oracle Linux Server release 6.5
David SankovskySenior SysAdminCommented:
ok, what you need to do is edit teh file /etc/sudoers
Then, assuming you named you user user1, add the follwing line:

user1           ALL=(ALL)       ALL

Open in new window


You can add it under the line that reads

root           ALL=(ALL)       ALL

Open in new window


Hope that helps

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mac_gAdmin - Middleware ServersAuthor Commented:
In order to resolve the below issue .. am looking to change setting.

---
[bkp@srv~]$ rpm -Uvh AvamarClient-linux-rhel4-x86_64-7.1.100-370.rpm
error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)
--
uid=1102(testbkp) gid=0(root) groups=0(root)
--
is that correct way to alter to sudo user  ??
David SankovskySenior SysAdminCommented:
mac_g, manually changing the gid for a user is not recommended under any circumstances, please follow my instruction to provide su access to a user.
mac_gAdmin - Middleware ServersAuthor Commented:
how to edit file - /etc/sudoers to give "backup" user  not to get below error when he runs below cmd.
can u please advice



[bkp@srv~]$ rpm -Uvh AvamarClient-linux-rhel4-x86_64-7.1.100-370.rpm
error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)
David SankovskySenior SysAdminCommented:
after you edited the sudoers file,
the backup user should run the command with sudo before it, or use su to move up to root level before executing the command.
Mahesh YCommented:
If you are having root logins , why don't you install rpm with same.
mac_gAdmin - Middleware ServersAuthor Commented:
storage  admin will  take care of Installing & configure  ... would be good to have other user
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.