Home
INTRODUCTION
ACCOUNT TYPES
FUNDAMENTALS
PORTS
USERS AND GROUPS
PERMISSIONS
FILE SYSTEMS
SECURITY
SYSTEM MANAGEMENT
NETWORKING
VIRTUALIZATION
SCRIPTING & AUTOMATION
TROUBLESHOOTING
CAREER-FOCUSED TOPICS
DEVELOPMENT & TOOLS
EXAM SPECIFICS
Home
INTRODUCTION
ACCOUNT TYPES
FUNDAMENTALS
PORTS
USERS AND GROUPS
PERMISSIONS
FILE SYSTEMS
SECURITY
SYSTEM MANAGEMENT
NETWORKING
VIRTUALIZATION
SCRIPTING & AUTOMATION
TROUBLESHOOTING
CAREER-FOCUSED TOPICS
DEVELOPMENT & TOOLS
EXAM SPECIFICS
More
  • Home
  • INTRODUCTION
  • ACCOUNT TYPES
  • FUNDAMENTALS
  • PORTS
  • USERS AND GROUPS
  • PERMISSIONS
  • FILE SYSTEMS
  • SECURITY
  • SYSTEM MANAGEMENT
  • NETWORKING
  • VIRTUALIZATION
  • SCRIPTING & AUTOMATION
  • TROUBLESHOOTING
  • CAREER-FOCUSED TOPICS
  • DEVELOPMENT & TOOLS
  • EXAM SPECIFICS
  • Home
  • INTRODUCTION
  • ACCOUNT TYPES
  • FUNDAMENTALS
  • PORTS
  • USERS AND GROUPS
  • PERMISSIONS
  • FILE SYSTEMS
  • SECURITY
  • SYSTEM MANAGEMENT
  • NETWORKING
  • VIRTUALIZATION
  • SCRIPTING & AUTOMATION
  • TROUBLESHOOTING
  • CAREER-FOCUSED TOPICS
  • DEVELOPMENT & TOOLS
  • EXAM SPECIFICS

Chapter 1

Creating users and groups

Test

The command

 "USERADD <Enter username>"


 is the name of the user account you want to create, and [options] are additional parameters you can use to specify various settings for the new user.

Some common options include:

  • -c: Adds a comment or a description for the user.
  • -m: Creates the user's home directory.
  • -g: Specifies the initial login group for the user.
  • -G: Specifies additional groups for the user.


Lets check our work in this file !

Cat /etc/passwd


 The cat /etc/passwd command is used to display the content of the /etc/passwd file on Unix-like operating systems, including Linux. This file is a system file that stores information about user accounts on the system 


 

The fields in the /etc/passwd file typically include:

  1. Username:
  2. Password: 
  3. User ID (UID): 
  4. Group ID (GID): 
  5. User Info:
  6. Home Directory: 
  7. Login Shell: 

Creating users and groups

The command

 "groupadd <Enter groupname>"


  In Linux, the groupadd command is used to create a new group. Groups in Linux are used to organize and manage users with similar access permissions to files, directories, and other resources. The groupadd command allows you to add a new group to the system. 

Lets check our work in this file !

Cat /etc/group


Each line in the file represents a separate group and includes several fields separated by colons. The fields typically include:

  1. Group Name: The name of the group.
  2. Password: An "x" character indicating that the encrypted password for the group is stored in the /etc/gshadow file.
  3. Group ID (GID): A unique numerical identifier for the group.
  4. Group Members: A comma-separated list of usernames that are members of the group.

Creating users and groups

The command

 "usermod -aG <groupname> <User> "


   

The usermod -aG command in Linux is used to add a user to one or more supplementary groups. Let's break down the options:

  • -a: Stands for "append" and is used to add the user to the specified group(s) without removing the user from their existing groups.
  • -G: Specifies the supplementary groups to which the user should be added. The group names are provided as a comma-separated list.

The Command

" groupmod -n <oldnname> <newname>


 The groupmod -n command in Linux is used to change the name of an existing group. 


 -n: Specifies the new name for the group. 

Creating users and groups

The command

 "groupdel <Group Name> "


    The groupdel command in Linux is used to delete a group from the system. 

Password check

checking under the file 

/etc/shadow  


if you see "!!" in the password field for a user in the /etc/shadow file, it means that the user account is currently locked, and the user cannot log in with a password. To enable login for that user, you should set a password for the account.


You can do this by using the passwd command. For example, if the locked user is named "username," you can run:  sudo passwd username 


Mario has "!!" compared to Greg and Mark. Which we see the encrypted password hash.

Creating Password and Admin Users

The Command 

Passwd <Enter Username> 

 

  • Just type passwd to change your own password. It will guide you through the process.
  • If you want to change another user's password (with permission), use "sudo passwd username".
  • You can force someone to change their password next time they log in with "sudo passwd -e username".
  • To lock or unlock an account, use "sudo passwd -l username" to lock and "sudo passwd -u username" to unlock.

The File

vi /etc/sudoers


The sudoers file is a crucial configuration file that determines which users are allowed to run commands as superusers (root) and the specific privileges they have. 

Username ALL=(ALL)   ALL

Meaning: <the who> allow=(all permission) allow 


The placement of entries in the sudoers file is important. The sudoers file uses a specific syntax, and the order of entries can affect how they are interpreted. The entries in the sudoers file consist of rules that define which users are allowed to run specific commands with elevated privileges. 

* Make sure to read and understand the file (ALWAYS MAKE A BACK-UP FILE) *

File:/etc/login.defs

 These settings help define password policies, user and group IDs, file creation defaults, and various aspects of user account management on the system.


 Admins can customize these defaults based on their security and operational requirements. 

File:/etc/skel

 
The "/etc/skel" directory on Linux is used as a template directory for new user home directories. When a new user account is created, the contents of the "/etc/skel" directory are typically copied into the user's home directory.


 This helps to provide a standardized and pre-configured set of files and directories for the new user. 


CHAGE COMMAND

Commands 


Chage -E <Date> <Username >

 The chage -E command in Linux is used to set or change the expiration date for a user account (expiration date in YYYY-MM-DD format.) 

Chage -M <Date> <Username>

 The chage -M command in Linux is used to set or change the maximum number of days between password changes for a user. 

Chage  -W <Date> <Username>

 The chage -W command in Linux is used to set or change 

Show More

Creating directories and files +permissions

A permission string is a set of characters that indicates who can do what with a file. There are three sets of permissions:


1) User Permissions (Owner):

  • First character: Owner's permissions (e.g., read, write, execute).

2) Group Permissions:

  • Next three characters: Group's permissions (e.g., read-only, write, execute).

3) Other Permissions:

  • Last three characters: Others' permissions (e.g., read-only, write, execute).


For example, a permission string like <rw->(r--){r--} means the <owner> can read and write, the (group) can read, and {others} can read.

Managing permissions is crucial for controlling access to files and maintaining system security. The chmod command is used to change these permission strings in Unix-like systems.

What is a Directory?!

A directory in IT serves as a container for organizing and structuring files and other directories. It provides a systematic way for users to manage and locate data on a computer system. 

What is a file?!

 A file is a collection of information or data stored on a computer. Each file has a unique name and a specific type, like a text document or an image. Files are organized in folders on a computer, and they can be created, opened, edited, and deleted. They can also have attributes like read-only or hidden. Understanding files is basic to using computers because they hold everything from documents to pictures and videos. 

Copyright © 2025 Linux Intel - All Rights Reserved.

Powered by GoDaddy

This website uses cookies.

We use cookies to analyze website traffic and optimize your website experience. By accepting our use of cookies, your data will be aggregated with all other user data.

Accept