How to Manage Users in Linux
Unlike Windows, as a Unix-like system, Linux was conceived of as a multi-user system from its inception. The following sections deal with user management through the Linux command line. Type adduser -d /home/users/ into the command line.
Method 1 of 4:
Adding Users
-
How to Manage Users in Linux Picture 1
Type adduser -d /home/users/ into the command line.- Example: adduser bob -d /home/users/bob
-
How to Manage Users in Linux Picture 2
Type passwd and press return to set a password for the new user.- Type the new password.
- Confirm the password.
Method 2 of 4:
Modifying Users
Changing Passwords
-
How to Manage Users in Linux Picture 3
Type passwd in the command line. -
How to Manage Users in Linux Picture 4
Enter the new password for the user.- Note: the cursor will not move however your password is being typed.
-
How to Manage Users in Linux Picture 5
Confirm the new password.
Method 3 of 4:
Removing Users
-
How to Manage Users in Linux Picture 6
Type userdel into the command line to delete a user.- Example: userdel bob
-
How to Manage Users in Linux Picture 7
Type userdel -r to also delete their home folder and files.
Method 4 of 4:
Sudo and Su
Terms
- sudo: Switch User and Do
- Executes a command as root or another use while maintaining your current session.
- su: Switch User
- Switches your session to another user.
How to Manage Users in Linux Picture 8
- Switches your session to another user.
Usage
-
How to Manage Users in Linux Picture 9
Type sudo before a command to execute the command as the root user. You will be prompted for a password.- Example: sudo apt-get install telnet
-
How to Manage Users in Linux Picture 10
Type sudo before a command to execute the command as another user on the system. You will be promoted for that users password.- Example: sudo bob telnet localhost 22
-
How to Manage Users in Linux Picture 11
Type su to switch your command line session to the root user. You will be promoted for a password.- Type logout to switch back.
-
How to Manage Users in Linux Picture 12
Type su to switch your command line session to another user. You will be promoted for their password.- Type logout to switch back.
5 ★ | 1 Vote
You should read it
- How to set and change a user password in Linux
- How to manage user passwords from Terminal in Linux
- How to change Windows user account password using Command Prompt
- How to Change a Computer Password Using Command Prompt
- How to Hack Into a Windows User Account Using the Net User Command
- The command changes user in Windows
- How to Bypass Windows 7 Password
- Instructions for changing Windows passwords without having to remember the old password
- USER_NAME function in SQL Server
- How to reset WSL user password
- How to Reset SA Password in Sql Server
- SYSTEM_USER function in SQL Server