Solved

Give Normal User Root Access in RedHat

Posted on 2015-01-13
9
308 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 76

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 76

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 76

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 27

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

746 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

12 Experts available now in Live!

Get 1:1 Help Now