Linux Adding Users and Admin Users

📢 This article was translated by gemini-3-flash-preview

This article was written by Hiyoung

Adding Admin Users

1. Create a new user (let’s name it temp_test)

adduser temp\_test
**2. Set the new user's password**

passwd temp_test

3. Change sudoers file permissions to writable

chmod -v u+w /etc/sudoers

4. Edit the sudoers file with vim

vim /etc/sudoers

5. Add the following content to the sudoers file

Find root ALL=(ALL) ALL

Then add temp_test ALL=(ALL) ALL

If you want the user to use sudo without entering a password, change the last ALL to NOPASSWD:ALL.

6. Change sudoers file permissions back to read-only

chmod -v u-w /etc/sudoers

7. Delete the user

userdel temp_test

This post is licensed under CC BY-NC-SA 4.0 by the author.