Introduction:
Unlock the power of Linux by mastering user administration – an essential skill for smooth system management. In this beginner-friendly guide, we’ll take you through simple steps to handle user accounts on your Linux system. Whether you’re a newcomer or looking for a quick refresher, this tutorial is tailored for everyone.
Step 1: Open the Terminal
Begin by opening the terminal, your gateway to the Linux command world. Press Ctrl + Alt + T
or find it in your system menu.
Step 2: Add a New User
Use the adduser
command followed by the desired username to add a new user:
adduser newusername
Step 3: Set Password
Set a secure password for the new user when prompted. Confirm the password to ensure accuracy.
Step 4: Grant Administrative Privileges (Optional)
If you want the user to have administrative privileges, add them to the sudo group:
usermod -aG sudo newusername
Replace “newusername” with the actual username.
Step 5: Remove a User
To remove a user, use the userdel
command:
sudo userdel -r oldusername
Replace “oldusername” with the username you want to remove.
Step 6: Change User Password
To change a user’s password, use the passwd
command:
sudo passwd username
Replace “username” with the specific user’s name.
Step 7: Lock and Unlock User Accounts
To lock a user account, use the passwd
command with the -l
option:
sudo passwd -l username
To unlock, use the -u
option:
sudo passwd -u username
Conclusion:
User administration on Linux is now at your fingertips. With these straightforward steps, you can confidently add, modify, and remove user accounts. Empower your Linux experience by managing users efficiently.