

#HOW TO ADD A USER ACCOUNT UBUNTU PASSWORD#
To do that we first must set an initial password with the command: However, we’re going to set the password such that the user will have to change their password upon first login. Next, we need to set the password for the user. We include the -m option to ensure the home directory is created along with the user. You’ve just created a new user and given them sudo privileges on Ubuntu Server. For this we’ll use the usermod command like so: With the new user created, it’s time to give them sudo rights. The adduser command will also automatically create the new user’s home directory, so you don’t have to worry about that. The adduser command will not only have you create a password for the user, but also have you enter the following (optional) details: Where USERNAME is the name of the user you want to add.

The first command will create the new user: Here, you can take care of creating the user with only two commands.
#HOW TO ADD A USER ACCOUNT UBUNTU HOW TO#
How to create a sudo-able user on Ubuntu Serverįirst, we’ll demonstrate how this is done on Ubuntu Server. SEE: Linux service control commands (TechRepublic Premium) What you’ll need

I’ll demonstrate this on both Ubuntu Server 20.04 and CentOS 8, so you should be able to handle the task no matter what distribution you’re on.

In fact, I’m going to walk you through the process of creating an admin-ready user on Linux with just a few quick commands. Problem is, when you create a new user, that user doesn’t have admin privileges. You create new users on your Linux servers and let those admins do their thing. After all, if you attempt to do everything yourself, eventually you’re going to make a mistake, and mistakes can be disastrous in today’s light speed world of business. That’s why you dole out tasks to those admins under you. There’s a lot to be done and doing this with a nod to security makes the task even more challenging. If you’re a Linux system admin, you probably find yourself scrambling to keep everything in check every day. Here’s the syntax:Īdding new user `thegeek’ (1004) with group `thegeek’.Online privacy: DuckDuckGo just finished a banner year and looks for an even better 2022Ĭheck for Log4j vulnerabilities with this simple-to-use scriptĨ advanced threats Kaspersky predicts for 2022Įnd user data backup policy (TechRepublic Premium) The adduser command is even easier than the useradd command, because it prompts you for each piece of information. I find it slightly funny that there are two virtually identically named commands that do the same thing, but that’s linux for you. If you wanted to set default path options for all new users, you would do so by modifying the files in /etc/skel, which would then be used to create these files by the useradd command. You’ll notice that there are bash scripts in this directory. If we take a look at the new home directory for the ls -la /home/testuserĭrwxr-xr-x 2 testuser testuser 4096 11:34. If you wanted to set default values for your users, you would do so by modifying or adding files in that directory. This will create the user named testuser and give them their own home directory in /home/testuser. The files in the new home directory are copied from the /etc/skel folder, which contains default home directory files.
