Just Tech Me At
April 13, 2023
(updated July 10, 2023)
Cybersecurity is the protection of computer systems and networks from attack by malicious actors. Many companies achieve their cybersecurity initiatives through the use of blue and red teams. Blue teams provide defensive protection of a system, network, or application. The red team's objective is primarily offensive with activities geared towards simulated attacks on a system, network, or application in order to identify vulnerabilities and weaknesses. Together, red and blue teams play a critical role in keeping systems and data safe from intrusion.
This series of articles will cover some of the aspects of blue team (defensive) operations. While there are many components of blue team operations, these articles will address 4 key activities of defensive cybersecurity and give you foundational knowledge on the topic. The activities are as follows:
We'll now explore some of the most commonly used Linux commands employed by blue teams for access control.
Disclaimer: This site does not any encourage unethical hacking behavior. In fact, the cybersecurity articles posted on the website focus on defensive security (blue team operations). Vulnerability exploitation is not a topic covered on this website. If you haven't already done so, start your cybersecurity journey by reading and understanding ethical hacking concepts.
Access Control is another critical component of cybersecurity. Below is a description of commands commonly utilized for access control.
There are many commands that can be used for access control in Linux. Here are 7 commands that can be useful in accomplishing the task. They can be used to manage user accounts, assign permissions to files and directories, and control access to system resources. Each command has many options and variations. Consult the manual pages to determine which ones work best for your needs.
Additionally, Linux distributions often include graphical user interfaces for access control management, such as the GNOME User Accounts tool and the KDE System Settings tool.
chmod - used to change the permissions of files and directories. The syntax for the command is chmod [permissions] [file/directory].
There are two methods for specifying file and directory permissions: Absolute Mode and Symbolic Mode. To make a file read only to the members of its assigned group using symbolic mode, issue the following command:
chmod g=r some_file.txt #symbolic mode
Learn more about Absolute Mode and Symbolic Mode with Comptia.
chown - used to change the ownership of files and directories. The syntax for the command is chown [owner:group] [file/directory].
The chown command typically requires the use of root permissions (sudo/root). Simply owning the file will not give you permission to transfer ownership of that file.
sudo chown [new_owner] someFile.txt
adduser - used to create a new user account. The syntax for the command is adduser [username]. The useradd command is also available.
adduser vs useradd
The commands typically require the use of root permissions (sudo/root).
sudo adduser [new_username]
To learn more about the difference between adduser and useradd, try linuxandubuntu.com.
passwd - used to change the password for a user account. The syntax for the command is passwd [username].
The passwd command is interative. The process of changing a password requires verification of current password before changing and validating a new password.
To change a password, issue the following command:
passwd [username]
To expire a password effective immediately, issue the following command:
passwd -e [username]
To to set a password to expire after a specified number of days, the -i option can be used. The following command will set the password to expire in 2 days:
passwd -i 2 [username]
su - used to switch to another user account. The syntax for the command is su [username].
The su command will require that you have the password credentials of the user to which you want to be switched.
su [username]
sudo - used to execute a command with administrative privileges. The syntax for the command is sudo [command].
One example of an instance where sudo would be utilized is package installation. If you are not working under root user mode (whoami does not indicate root user) but have root credentials, you can issue the following command:
sudo [apt install] [package_to_install]
The Difference Between sudo and su
sudo | su |
---|---|
Allows you to issue commands as another user without changing your identity. | Switches you to a particular user. |
An entry in /etc/sudoers is required to execute. | Root user is the default if a username is not specified. |
sudo asks for your password. | su asks for the password of the user to whom you are switching. |
groups - used to display the groups that a user belongs to. The syntax for the command is groups [username].
groups [username]
Access control is a critical component of cybersecurity and information security in general. The linux commands mentioned in this article aid in the security process by placing restrictions on who is authorized to access company data and resources. To learn more about access control and the four types of access control, see the Citrix article "What is access control?"
A1: Access control refers to the security measures and mechanisms put in place to manage and regulate access to systems, networks, applications, and data. It ensures that only authorized individuals or entities can gain access to resources, while unauthorized access is prevented or restricted.
A2: Access control plays a critical role in cybersecurity for several reasons:
A3: Access control can be categorized into three primary types:
A4: The key components of access control typically include:
A5: Role-based access control (RBAC) is a widely used access control model that assigns permissions and access rights based on predefined roles. Users are assigned specific roles, and access privileges are granted based on those roles, simplifying the management of access control in larger organizations.
A6: Access control can be enforced through several measures, including:
A7: Access control frameworks provide a structured approach to implementing access control measures within an organization. Examples include the NIST RBAC model, the ABAC (Attribute-Based Access Control) model, and the Zero Trust framework. These frameworks offer guidelines, methodologies, and best practices for designing and implementing access control solutions.
A8: Yes, access control can be automated using identity and access management (IAM) systems, which centralize access control policies, user provisioning, and authentication mechanisms. IAM solutions simplify user administration, ensure consistent access controls, and enable efficient enforcement of access policies.
A9: Common access control challenges include:
A10: Access control forms a vital layer in a defense-in-depth security strategy. By controlling access to systems and data, it helps protect critical assets from unauthorized access and reduces the attack surface. Access control complements other security measures, such as firewalls, intrusion detection systems, and encryption, to create a multi-layered defense against cyber threats.
For more articles on Cybersecurity, see the following:
Let Tutorials Point get you on your way. Visit and enroll today!