Solved

Give Normal User Root Access in RedHat

Posted on 2015-01-13
9
325 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 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 78

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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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 78

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 78

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 30

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Utilizing an array to gracefully append to a list of EmailAddresses
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

691 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