How to easily add and delete users on Ubuntu
Each person can have their own wallpaper, settings, and browser favorites. If any user stops using your PC, you should consider deleting that account as well. You can easily add or remove users on Ubuntu through the terminal by following the steps below.
How to add a new user account on Ubuntu
On Ubuntu PCs (and indeed on most Linux distributions), user accounts can have different levels of access and permissions. Each user gets a specific ID number called a user ID (or UID) and their own home directory where they can store their personal files.
Sometimes, you may need to add new users. This can be easily done from Terminal using the adduser command. You will need root access to do this - you can elevate the command with sudo. To add a new user account on Ubuntu, follow these steps.
1. Open a new terminal window.
2. Type sudo adduser user , replace user with the desired user name, and press Enter .
3. You will be prompted to create and verify a password for the new user - follow the on-screen instructions to do this.
4. Follow the prompts to fill in the new user's information. You can bypass this by pressing Enter for each prompt.
5. Once completed, the new user will be ready to use their account.
How to grant root access to users on Ubuntu
If you recently created a new user account and want to give it root-level access on your Ubuntu PC, you can do so using the usermod command. Giving a user root access on Ubuntu means adding that user to the sudo group , meaning they can elevate their commands to run as root.
Allowing users to run commands as sudo poses certain risks because they will be able to access any file or folder on your PC and make any changes they want to the system. your system. Only give users superuser permissions if you trust them - otherwise, let them have regular user access.
To grant root access to a user on Ubuntu, follow these steps.
- Open a new terminal window.
- In Terminal, type sudo usermod -aG sudo user , replace user with the correct username, and press Enter .
- To verify the user has been added to the sudo group, type groups user and press Enter , replacing user with the username. This will list that the user is currently a member of the sudo group .
How to delete user accounts on Ubuntu
If you want to delete your Ubuntu user account, you can use the deluser command (as long as you have root access with sudo). You can use this command to remove users and leave their home directory intact. Additionally, if you want to delete their files, you can also use it to delete their home directory.
To remove Ubuntu users, follow these steps.
1. Open a new terminal window.
2. Type sudo deluser user to delete the user account without deleting their home directory. Replace user with the correct username before you press Enter , and provide your password if prompted to do so.
3. If you also want to delete the user's home directory, type sudo deluser --remove-home user (replace user with the correct username) and press Enter .
4. Next, enter the user id (replace user with the correct username). If the command is successful and returns a value, the username still exists and you may need to repeat the process. If it fails with such a no user error message then the user account has been successfully deleted.
Manage access to your Ubuntu PC!
Using the steps above, you will be able to quickly manage access to your Ubuntu PC by adding and removing users as needed. Adding a new user account is simple, but if you decide to delete an account, make sure to back up any files from their user folder first - you may lose them in the process.
Be sure to control who has root-level administrative access, depending on who is planning to use your PC.
You should read it
- Why is Ubuntu LTS preferred over regular distros?
- What's new in Ubuntu 18.04 LTS just released?
- How to prolong the life of Ubuntu 18.04 installation with Ubuntu Pro
- What is the difference between Ubuntu Desktop and Ubuntu Server?
- Ubuntu 21.04 users need to update the system ASAP
- 5 things to do after upgrading to Ubuntu 22.04 LTS
- 5 Reasons Ubuntu Cinnamon Is Better Than Other Ubuntu Versions
- 10 reasons to choose Ubuntu 12.10 instead of Windows 8
May be interested
- What is the difference between Ubuntu Desktop and Ubuntu Server?ubuntu is divided into ubuntu cloud, ubuntu core, ubuntu kylin, ubuntu desktop and ubuntu server. in this article, we will explore all the similarities and differences between ubuntu server and ubuntu desktop.
- How to install Ubuntu in parallel with Windows using USBinstalling ubuntu in parallel with windows 7 and 8 with usb will help users not to waste time writing files to disk, running on many different computers.
- Simple way to create Quicklist for Ubuntu Unity Launcheralthough this feature is really essential for ubuntu users, creating them is not just a click away. so how to create / edit quicklist items for the application more easily?
- How to install Pip in Ubuntulinux has a lot of package managers. ubuntu not only has apt but also many programming languages that come with its own package manager. pip stands for python packages packages and allows you to easily install packages from python package index (pypi).
- How to fix the error is not logged in Ubuntuone of the most common and controversial errors that ubuntu users encounter is the login boot loop. when you try to log in to ubuntu after booting, you will be taken back to the login screen and the process is infinite.
- Canonical Urges Ubuntu 20.04 LTS Users to Upgrade or Purchase Extended Supportas a long-term support release, ubuntu 20.04 lts (long-term support) will be supported with continuous updates for a total of 5 years, meaning it will reach end-of-life around april 2025.
- How to install AVG Antivirus on Ubuntuin addition to windows, you can install avg antivirus on ubuntu easily and quickly to ensure that damage is minimized in the most optimal way. along with tipsmake, see how to install avg antivirus on ubuntu below.
- Instructions for downloading Ubuntu - Download the latest Ubuntuinstructions for downloading ubuntu - download the latest ubuntu. ubuntu is free and open source software, which means that users can freely run, copy, distribute, research, change and improve the software. that's one reason why software developers or developers often use this ubuntu operating system.
- 5 things to do after upgrading to Ubuntu 22.04 LTSubuntu 22.04 lts jammy jellyfish is the latest version of the popular open source operating system ubuntu. installing a fresh copy on a freshly wiped hard drive will give you a great computing experience.
- 5 Reasons Ubuntu Cinnamon Is Better Than Other Ubuntu Versionsubuntu cinnamon became an official ubuntu release in 2023. it gives you ubuntu but with the cinnamon desktop environment instead of gnome.