i've got a regular user i want to turn into admin group so he can have same privileges as a root.
should i just change the GID in /etc/passwd and /etc/group or should i use usermod/groupmod?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
You do not want to make this user EXACTLY the same as root. Don't change uid and gid. You have a few options:
Use sudo. sudo lets a user execute a command or start a shell as root, without needing the root password. However, the admin of the computer can tightly control which commands a user can "sudo". Read up the man page. But if you want an easy "let this user run any thing with sudo", put this user in the /etc/sudoers file. Even better, put this user in the admin group then add the line
%admin ALL=(ALL) ALL to /etc/sudoers. On Ubuntu, this is probably your best option as sudo is installed by default.
Put this user in the wheel or admin group. This user won't be root, but will have the same access to files as everyone else in wheel or admin.
Give the user the root password and make this user use
su <cmd>. This is a bad idea. On recent versions of Ubuntu, the root account can't login by default so you can't do this.
You have many choices when adding a peson as a sudoer. You don't have to give them blanket root access if you don't want to. In general the lines in /etc/sudoers looks like:
usernames/group servername = (usernames command can be run as) command
There are some general guidelines when editing this file:
You can use /etc/sudoers to grant specific access to specifc people for any or all applications.
This site includes some decent examples.