Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Linux :how to provide sudo access to the user

Posted on 2016-07-25
13
Medium Priority
?
162 Views
Last Modified: 2016-07-27
Linux OS:

please advice the steps required to provide the sudo access to the user.
0
Comment
Question by:mac_g
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
13 Comments
 
LVL 22

Expert Comment

by:David Atkin
ID: 41727657
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
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 41727670
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
0
 
LVL 88

Expert Comment

by:rindi
ID: 41727738
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.
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

Author Comment

by:mac_g
ID: 41727752
Can you please provide the steps ?
0
 
LVL 7

Expert Comment

by:David Sankovsky
ID: 41727792
There are several ways to do this and they change based on the distro you are using.
What distro are you working on?
0
 

Author Comment

by:mac_g
ID: 41727805
Oracle Linux Server release 6.5
0
 
LVL 7

Accepted Solution

by:
David Sankovsky earned 2000 total points
ID: 41727812
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
0
 

Author Comment

by:mac_g
ID: 41727858
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  ??
0
 
LVL 7

Expert Comment

by:David Sankovsky
ID: 41727870
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.
0
 

Author Comment

by:mac_g
ID: 41727888
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)
0
 
LVL 7

Expert Comment

by:David Sankovsky
ID: 41727895
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.
0
 
LVL 1

Expert Comment

by:Mahesh Y
ID: 41729928
If you are having root logins , why don't you install rpm with same.
0
 

Author Comment

by:mac_g
ID: 41730671
storage  admin will  take care of Installing & configure  ... would be good to have other user
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question