How to check all user in linux
Every user who has access to a Linux system needs a login and a password. Each user must belong to a primary group and for security or access purposes can belong to several secondary groups.
In order to create new logins, modify or delete users, you must already be logged in as root. The root login is the highest level and only certain individuals should have access to the root account.
Options:
- -d home directory
- -s starting program (shell)
- -p password
- -g (primary group assigned to the users)
- -G (Other groups the user belongs to)
- -m (Create the user's home directory
Example: To add a new user with
- a primary group of users
- a second group operation
- starting shell /bin/bash
- password of xxxx
- home directory of shiv
- create home directory
- a login name of shiv
usermod - Modifying existing user
- -d home directory
- -s starting program (shell)
- -p password
- -g (primary group assigned to the users)
- -G (Other groups the user belongs to)
Example: To add the group 'others' to the user shiv
Userdel : Deleting a user
- -r (remove home directory)
passwd : User’s Password
- user's name (Only required if you are root and want to change another user's password)
Enter existing password
Enter new password
Enter new password again (to validate)
Enter existing password (can be either roger's password or root's password)
Enter new password
Enter new password again (to validate)
Where user and group information stored
- User (name normally all lower case)
- Password (encrypted - only contains the letter 'x')
- User ID (a unique number of each user)
- Primary Group ID
- Comment (Normally the person's full name)
- Home directory (normally /home/<user name>
- Default shell (normally /bin/bash)
- Group name
- Group password (hardly ever used)
- Group ID
- User names (separated by commas)
Su : Switch User
#su
Enter root's passwd
#su shiv
Enter shiv's or root's passwd



07:23
Rishi
Posted in: