Thursday, February 20, 2025

How to create a user in ubuntu with password giving all permissions ?

 o create a new user in Ubuntu with a password and grant them all permissions (including administrative privileges), follow these steps:

1. Create a New User

Run the following command, replacing username with your desired username:


sudo adduser username
  • You will be prompted to enter a password and some optional details.

2. Add User to the Sudo Group

To grant full administrative permissions, add the user to the sudo group:


sudo usermod -aG sudo username
  • This allows the user to execute commands as root using sudo.

3. Verify the User’s Permissions

Switch to the new user:


su - username

Then check if the user can run sudo commands:


sudo whoami

If it returns root, the user has full administrative access.

4. (Optional) Grant Passwordless Sudo Access

If you want the user to execute sudo commands without entering a password:


echo "username ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/username

Now the user has full administrative privileges. 

No comments:

Post a Comment

Reset Ubuntu with factory reset & and reinstall

  Try configuring unconfigured packages: sudo dpkg --configure -a Update the contents of the repositories sudo apt-get update Try to fix mis...