Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to give my user account root access rights permanently, how can i do that? (i don't want to login using the root account). thx!

share|improve this question

migrated from stackoverflow.com Mar 9 '12 at 1:51

This question came from our site for professional and enthusiast programmers.

    
switch to your root account with su, then add the target account to sudo group sudo usermod -a -G sudo target_account. Now the target account can execute command with root privilege. –  dien Mar 8 '12 at 15:31

3 Answers 3

  1. Install sudo: # yum install sudo
  2. Add user to /etc/sudoers: # visudo

Add a line like: useraccount ALL=(ALL) ALL there.

share|improve this answer

First off let me start by saying operating as a root level user all the time is dangerous. You should use Su or sudo for admin tasks. However if you insist you have some choices. You can give your user root level access by editing the /etc/group file. Add the same rights as root. Or you can rename your root user in the /etc/group /etc/shadow and /etc/password files. This is advisable on any public facing systems along with disabling login for tgat user via ssh. All brute force scripts try root, admin and administrator. Theywill usually not spend as much effort on the bob account. Usually these types of attacks are looking for easy targets.

Again, operating as root level user all the time is a bad idea. Get used to Su and sudo. They are annoying at times but they are necessary.

share|improve this answer
    
Reassigning or giving root access rights to a user without any other barrier in place is not only dangerous but is downright negligent. Even if the server was disconnected from the internet and buried six feet underground you still should not do it. –  Wilshire Mar 12 '12 at 18:11
    
You can't make any other user than root have actual UID 0! –  Marki Aug 17 '13 at 23:22

Add the user to sudo-ers - http://forums.fedoraforum.org/showthread.php?t=154027

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.