Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 tried to make my account root by editing etc/group:


But it didn't succeed. What can I do more?

share|improve this question
There is only one root, and his UID is zero. The rest are normal users. The adm group does pretty much nothing in most Linux distros. Even the root group gives no access. – grawity Sep 17 '10 at 20:44
Living in an account with root privs on all the time is a terrible idea. You will accidentally destroy your system by running a poorly-written app or issuing a slightly wrong shell command, if malware doesn't get you first. Back when personal computer OSes didn't have separate accounts, so you were effectively root all the time, there were safeguards so that even as root, you couldn't shoot yourself in the foot too easily. Those safeguards don't exist anymore, because you're not expected to run as root all the time. – Spiff Sep 17 '10 at 22:08

Depending on what you're trying to do, the correct way to perform tasks as root is to use sudo or to use su or login as root.

share|improve this answer
My account is configured with lots of private data and it would be iritating moving everything to root. So I want just to set it to root because using everywhere sudo isn't comfortable and it's only my home PC. – oneat Sep 17 '10 at 20:38
@oneat Moving what to root? You won't lose access to your own files. /// "it's only my home PC" must've been exactly what the Windows XP guys said when making all users Administrators by default. – grawity Sep 17 '10 at 20:42
You can use sudo -s to get a root shell so you don't have to keep typing sudo. – Spiff Sep 17 '10 at 22:05
I mean favorites and places. – oneat Sep 18 '10 at 7:55
@oneat: If you need to run GUI apps as root, use gksudo. – Dennis Williamson Sep 18 '10 at 8:05

What you seem to have done is add your user to the adm and root groups. This, by itself, does not make your account root.

There are two common ways of being an administrator on unix systems: * either know the password for the root user, and call su to run commands as root; * or be registered as a sudoer, and call sudo to run commands as root.

The way to register as a sudoer is to be listed in the sudoers file (which you can edit by running visudo as root — never update this file manually or demons will eat your children's souls). Sudo can be set up so that all members of a certain group are sudoers; for example, on Ubuntu, all members of the admin group are sudoers.

If you already had the permission to run sudo, the changes you've made won't do anything useful. I recommend you carefully undo them: it's always a bad idea to mess up with security settings you don't understand.

Prefixing commands to run as root with su or sudo is the normal way to do things under unix. If you feel you have to do it too often, it probably means you've tackled some problem the wrong way. Unless you administer a multi-user machine or multi-usage server, few common tasks require explicitly running commands as root.

share|improve this answer

The group root (gid=0) has practically no meaning.

You could create a new user that shares the same uid=0 with root, and you could even give it a different password and shell and homedir, too. Some tools don't cope well with a many-to-one user-to-uid mapping, though.

Historically, members of the group wheel are allowed to su to root, and most distributions are set up to allow members of wheel and/or adm to sudo. This is a much better mechanism than attempting to bestow your account with permanent uid=0 powers.

Editing /etc/passwd, /etc/shadow, /etc/group, /etc/gshadow, etc. by hand is an easy way to break your system.

share|improve this answer
I'm allowed too. But I prefer graphical interface instead Command line. – oneat Sep 18 '10 at 8:01

Don't do it. You will inevitably screw up your system completely running as root all the time.

What task do you find yourself performing so often that you must become root to handle it?

share|improve this answer
I'm testing tools, configuring my system etc. I just don't like to lunch everything from command line instead clicking it. And I also want to have my pulpit and everything under my hand. – oneat Sep 18 '10 at 8:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .