Home
Random
Log in
Settings
About freem
Disclaimers
freem
Search
Editing
How to Add New Users to Linux
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
Adding new users to a Linux system is a common task for system administrators or users who want to grant access to other people to use the system. Here are the general steps to add new users to a Linux system: 1. Open a terminal window and log in as the root user or a user with sudo privileges. 2. Use the `adduser` command to add a new user. For example, to add a user named "johndoe", type the following command and press Enter: ``` adduser johndoe ``` You will be prompted to enter the new user's password and some other information such as full name, phone number, etc. You can choose to skip some of the fields by pressing Enter. 3. After you have provided the required information, a new user account will be created with the username and home directory. The home directory for the new user will be created under the /home directory. 4. To grant administrative privileges to the new user, you can add the user to the sudo group by typing the following command and press Enter: ``` usermod -aG sudo johndoe ``` This will add the user "johndoe" to the sudo group, which allows them to execute commands with root privileges using the `sudo` command. 5. Finally, you can test the new user account by switching to the user's account by typing the following command and press Enter: ``` su - johndoe ``` This will switch to the new user's account and you can test that everything is working correctly. That's it! You have successfully added a new user to your Linux system.
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)