Solved

Give Normal User Root Access in RedHat

Posted on 2015-01-13
9
312 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
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 12

Assisted Solution

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

Assisted Solution

by:NickUpson
NickUpson earned 83 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 77

Assisted Solution

by:arnold
arnold earned 84 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
 
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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 77

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 167 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 77

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 167 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 28

Assisted Solution

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

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
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 how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now