Create a new root user in ubuntu
To create a new root user in Ubuntu, you can follow these steps:
Method 1: Using the useradd
command
-
Open a terminal as the current user (not as root).
-
Run the following command to create a new user:
sudo useradd -m -s /bin/bash newroot
Replace
newroot
with the desired username. -
Set a password for the new user:
sudo passwd newroot
Follow the prompts to set a password.
Method 2: Using the adduser
command
-
Open a terminal as the current user (not as root).
-
Run the following command to create a new user:
sudo adduser newroot
Replace
newroot
with the desired username. -
Set a password for the new user:
sudo passwd newroot
Follow the prompts to set a password.
Method 3: Using the GUI
- Log in to the Ubuntu desktop.
- Click on the "Dash" icon in the top left corner and search for "Users".
- Click on "Users" to open the Users settings.
- Click on the "Unlock" button and enter your password.
- Click on the "Add User" button.
- Fill in the required information, including the username, password, and other details.
- Click on the "Add" button to create the new user.
Note: By default, the new user will not have root privileges. If you want to grant root privileges to the new user, you can use the sudo
command to elevate their privileges. For example:
sudo usermod -aG sudo newroot
This will add the new user to the sudo
group, allowing them to run commands with root privileges.