?
Solved

Give Normal User Root Access in RedHat

Posted on 2015-01-13
9
Medium Priority
?
331 Views
Last Modified: 2015-04-14
Hi Experts!

I need to add a normal user so when they log in they have the same permissions as root.  I've tried a couple of methods but do not think it's working when I log in as that user.

I've used:  vim /etc/passwd and have tried to change their numerical values to 0 but for some reason it's not saving that change and keeps reverting back to the old permissions that it was.  

I don't want them to have to su <username>, I'd just like this normal user to log in and automatically have root privileges.   Obviously, I normally wouldn't do this with my user accounts but this user is okay to have the this level of permissions.  

Thanks for any help you can provide with this!
0
Comment
Question by:itsmevic
[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
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 12

Assisted Solution

by:Kent W
Kent W earned 332 total points
ID: 40547766
Add the user to your "wheel" group in /etc/group
0
 
LVL 19

Assisted Solution

by:NickUpson
NickUpson earned 332 total points
ID: 40547768
This is a really bad idea, in general but

usermod -o -u 0 loginid
 
(thats a zero not letter O)
0
 
LVL 79

Assisted Solution

by:arnold
arnold earned 336 total points
ID: 40547884
To allow a user to have root privileges, add the user to /etc/sudoers

the user can then elevate their rghts through the use of sudo.

presumably once a user has root level access as others pointed out the user can do anything on the system.

sudo allows you to limit the condition under which the user can have elevated rights.

what do you expect thi user to do that you are willing to give the person root rights?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 12

Expert Comment

by:Kent W
ID: 40547888
@arnold

OP said -
"I don't want them to have to su <username>, I'd just like this normal user to log in and automatically have root privileges."
0
 
LVL 79

Expert Comment

by:arnold
ID: 40547965
mugojava,

I saw your response and NickUpson's.

Presumably the reason su - is not desired because then the asker would need to provide the user the root's password.

Sudoers, does not require that. depending on the sudoers configuration the user would or would not be prompted for their own password to elevate their rights.
0
 

Assisted Solution

by:Douglas Santos
Douglas Santos earned 668 total points
ID: 40549338
@itsmevic

I think that the better thing is configure the sudoers without request the password like that.

Where %sudo is the group that you enable the access like root.
visudo -> this is call the /etc/sudoers for your configuration.

Add the follow line our create that.

%sudo ALL = NOPASSWD: ALL

After that put your user in group like that

useradd -G sudo username.

When you need to use something with root access you can use

sudo command_line

or

you could use something like that

sudo su -

Where your user will work like root without asking root password or your credentials again.
0
 
LVL 79

Expert Comment

by:arnold
ID: 40549430
sudo su -  what is the point?

would it not be the same as running sudo bash? or sudo any_other_shell?

sudo elevates the shell to root user, the user will be root on the system without the need for root password. Possibly the root users profile settings might not be available.
0
 

Accepted Solution

by:
Douglas Santos earned 668 total points
ID: 40549457
The point here is the sudo for call the sudoers and check if the user or the groups has access the execute some kind of command the su if we want to call other user for e.g:
su - douglas
I'll call the bash as douglas user.

the flag - is for call the variables for the user account like .bashrc .bash_profile and stuffs like that.

if I only call sudo /bin/bash or sudo /bin/sh I'll execute the bash like the current user.

If I call sudo su - I'll execute the shell as root and with their variables.

That's why.


The point of the account elevates the shell to root user without the root password might be possible or not. it's depends of the sudoers configuration.

we can configure it to execute only some kinds of commands or all of them.
0
 
LVL 30

Assisted Solution

by:serialband
serialband earned 332 total points
ID: 40549742
sudo su - is redundant

Use
sudo -i
as specified in the man page.
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

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 …
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month14 days, 6 hours left to enroll

771 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