How To Create A Root User in Ubuntu
How To Create A Root User in Ubuntu
A common problem that students face is: How to Run Ubuntu within Windows
i.e., without installing Ubuntu in dual mode. Windows provide a feature for this.
This feature is called “Windows Subsystem for Linux”. By default, this option
is disabled in Windows. There are some simple steps to activate this feature.
Below is step-wise procedure is with snapshots.
Pre-requisite: Windows 10
Step3: On the Left Pane click on “Turn Windows Features on or off”. A Popup
window will appear. Wait for the content to be visible.
Step 4: Scroll down until you find “Windows Subsystem for Linux”. By default it
is unchecked. Select it and press “ok”. The system will make changes and ask
for “Restart”. Restart the system as asked.
Step 8: Let it download and then launch it. Follow the steps as asked and you are good to go.
Step 9: After installation. Launch Ubuntu
How to Create a Root User in Ubuntu | Linux [Step-by-Step]
1. Open the terminal and which will be looks like -----@----:~#
2. Now type “sudo adduser irfan” and then press enter button, where sudo command grants
administrative privileges, adduser command is used for adding a user and irfan is the user
whom we want to create
3. Give password of the root user and then press enter
4. Then setup password for the new user, retype the password and press enter
5. Now press enter for default
6. Then press ‘y’ for the information is correct
7. Now, to check whether the user is created or not type “getent passwd | grep irfan” and
press enter
8. You will see that the user is successfully created
9. Now on going to add the user to the sudo group type “sudo usermod –aG sudo irfan” and
press enter, where usermod command modifies an existing user account, -aG adds user to
the specific group
10. Give the user password
11. Now, to check if the user is added to the group, type “groups irfan” and press enter and
you will see that the user is added to the group sudo
12. After adding the user to the sudo group, now to verify the user privileges, type “su -
irfan” and press enter, which switches the user to the new user i.e. irfan
13. Typing the password and pressing the enter again, you can see that you have switched to
the new user, which looks like “irfan@DESKTOP-C1QRO98:~$”
14. Now, to edit the configuration file, type “sudo visudo” and press enter, where visudo
command helps to edit the configuration file.
15. Replace the root with created user i.e. irfan and press Ctrl+S to save and Ctrl+X to exit
16. Now, to check the privileges, type “sudo whoami” and press enter, you will see that you
are root user now.
17. To set password for root user type, “sudo passwd root” and press enter, and it will ask to
enter new password and by giving the new password, password will be updated.
18. Now, to login to new root user type, “su -” and press enter
19. Provide the updated root password and you will successfully login to the new root user