Commands are typed and executed in a shell terminal. When a terminal is opened, a prompt is available which usually has the following format:
username@hostname$
Or:
root@hostname #
or simply as $ or #.
$ represents regular users and # represents the administrative user root. Root is the most privileged user in a Linux system.
Effected Files:
/etc/passwd,
/etc/shadow,
/etc/group
/etc/gshadow
We can create groups in a way to group users before or after creating users.
Adding/modifying groups:
groupadd
groupmod
gpasswd
groupdel
Switches -a : to add users
-d : to delete users
-m : to add multiple users
Eg :
#groups - displays group of user
Adding/modifying users:
Switches -a : to add users
-d : to delete users
-m : to add multiple users
useradd
usermod
passwd
userdel
chage
Eg:
#useradd
Or:
root@hostname #
or simply as $ or #.
$ represents regular users and # represents the administrative user root. Root is the most privileged user in a Linux system.
Effected Files:
/etc/passwd,
/etc/shadow,
/etc/group
/etc/gshadow
We can create groups in a way to group users before or after creating users.
Adding/modifying groups:
groupadd
groupmod
gpasswd
groupdel
Switches -a : to add users
-d : to delete users
-m : to add multiple users
Eg :
#groups
Adding/modifying users:
Switches -a : to add users
-d : to delete users
-m : to add multiple users
useradd
usermod
passwd
userdel
chage
Eg:
#useradd
- Username: User login name used to login into system. It should be between 1 to 32 charcters long.
- Password: User password (or x character) stored in /etc/shadow file in encrypted format.
- User ID (UID): Every user must have a User ID (UID) User Identification Number. By default UID 0 is reserved for root user and UID’s ranging from 1-99 are reserved for other predefined accounts. Further UID’s ranging from 100-999 are reserved for system accounts and groups.
- Group ID (GID): The primary Group ID (GID) Group Identification Number stored in /etc/group file.
- User Info: This field is optional and allow you to define extra information about the user. For example, user full name. This field is filled by ‘finger’ command.
- Home Directory: The absolute location of user’s home directory.
- Shell: The absolute location of a user’s shell i.e. /bin/bash.