Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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 Nguyen Mar 8 '12 at 15:31
  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 -

share|improve this answer

Your Answer


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