Add the user to the sudo group with:
adduser <username> sudo
(If you're running Ubuntu 11.10 or earlier, use the admin group.)
Default values are stored in /etc/adduser.conf, you can check them with
less /etc/adduser.conf
To create a user and add it directly to the sudo group use
adduser <username> --group sudo
(Again, use admin in place of sudo for 11.10 and earlier.)
Have a look at all the options you have with adduser here.
Add the user to the sudo group with:
adduser <username> sudo
(If you're running Ubuntu 11.10 or earlier, use the admin group.)
Default values are stored in /etc/adduser.conf, you can check them with
less /etc/adduser.conf
To create a user and add it directly to the sudo group use
adduser <username> --group sudo
(Again, use admin in place of sudo for 11.10 and earlier.)
Have a look at all the options you have with adduser here.
To create a new user with admin privileges in Ubuntu 12.04 and later:
adduser <username> --ingroup sudo
In Ubuntu 11.10 and earlier, use this instead:
adduser <username> --group admin
To modify a existing user (12.04 and later):
adduser <username> --group sudo
or
sudo usermod -aG sudo <username>
(Or for 11.10 and earlier: sudo usermod -aG admin <username>)
-a stands for append whereas -G stands for groups. With the -a and -G flags as shown above, the sudo (or admin) group will be added to the list of groups of which the user is a member.
Linux asks me to make the first user as admin during the installation
How do I create a user with admin privileges?
Standard user or admin for daily use
How do I run something as an administrator on linux
How do I delete a user in Linux?
How do I create a user with a home directory in Linux?
What is the difference between `useradd` and `adduser`?
Videos
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) ALLto /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.
Your best bet under ubuntu is to add the person to the sudoers file. You should use visudo to edit this file. If you hate vi, you can set the EDITOR shell variable to use your preferred editor.
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:
- Groups are the same as user groups and are differentiated from regular users by a % at the beginning. The Linux user group "users" would be represented by %users.
- You can have multiple usernames per line separated by commas.
- Multiple commands also can be separated by commas. Spaces are considered part of the command.
- The keyword ALL can mean all usernames, groups, commands and servers.
- If you run out of space on a line, you can end it with a back slash () and continue on the next line.
- sudo assumes that the sudoers file will be used network wide, and therefore offers the option to specify the names of servers which will be using it in the servername position in Table 9-1. In most cases, the file is used by only one server and the keyword ALL suffices for the server name.
- The NOPASSWD keyword provides access without prompting for your password.
You can use /etc/sudoers to grant specific access to specifc people for any or all applications.
This site includes some decent examples.
I am newbie to Linux OS.
I followed an online tutorial on how to setup RedHat for the first time. The instructor asks me to tick the option of make the first user as admin because it will be difficult to do that later.
Does that mean I have two admin users, which are the root and user1?
When I type su โ in the terminal it asks for root password not for the user1 password.
As I understand Bash are the command that I am typing in terminal. Is this true? does that mean all commands are called Bash commands?
Is there a difference between Terminal and Console please?
Bash is a commonly used shell but like most things in Linux there are many others to choose from. Admin accounts have permissions to elevate to root using sudo.
First, create the user with:
sudo adduser <username>
You can read more about this command in the man pages of your system with man adduser.
You can then add a user to the sudo group with with the command:
sudo adduser <username> sudo
Note that versions of Ubuntu until 11.10 will use admin as group instead of sudo:
Until Ubuntu 11.10, the Unix group for administrators with root privileges through sudo had been admin. Starting with Ubuntu 12.04 LTS, it is now sudo, for compatibility with Debian and sudo itself. However, for backwards compatibility, admin group members are still recognized as administrators
If your system does not, then we need to mess with the sudoers file to grant sudo permissions. You can read about the sudoers file with man sudoers for details on the exact syntax and available options, but for simplicity's sake, you can do either of the following:
- Create a group with the
addgroupcommand, and then add that group to the sudoers file. Useaddgroup <groupname>to create the group, and then edit the sudoers file (sudo visudo) and add the line%<groupname> ALL=(ALL) ALLto the bottom - Edit the sudoers file with
sudo visudo, and add<username> ALL=(ALL) ALLat the bottom for each user you want to add.
The "popular" answer is how to "reimplement", not "how to add the user?". Bare minimum you need to do is this:
usermod -a -G sudo USERNAME
On my particular system, I am a member of the following groups:
usermod -a -G adm,cdrom,sudo,dip,plugdev,lpadmin,sambashare,libvirtd USERNAME
To verify what you have done:
groups USERNAME
So new user here who has been reading up about Linux and decided to test run Linux Mint with dual boot when I read in some of the comments that it is not suggested for people to use root account for daily activities for security reasons. So I am just wondering if this root account is something that I need to activate (which then I do not plan on doing) or does it mean the administrative account that you get when you first made your account? If it is the admin account that you get when you make your first account should I add a standard account and then use that for my daily usage?