Linux Foundation Flashcards
Which of the following commands can be used to lock a user’s account so that they cannot log into a Linux server without removing any files, folders, or data?
A. lock
B. usermod
C. userdel
D. chmod
To lock a user’s account so that they cannot log into a Linux server without removing any files, folders, or data, you can use the usermod
command. Specifically, you would use usermod
to disable the account, effectively locking it. The usermod
command allows you to modify various user account properties, including disabling or locking a user’s account.
The appropriate option to lock a user’s account using usermod
is:
```bash
sudo usermod –lock <username>
~~~</username>
Replace <username>
with the actual username of the account you want to lock.
For example:
```bash
sudo usermod –lock john
~~~
This command locks the account for the user “john,” preventing them from logging in while retaining their files and data.
Which of the following technologies is supported by the majority of cloud providers in order to support the orchestration of containerized applications?
A. Kubernetes
B. Vagrant
C. Ansible
D. Terraform
A. Kubernetes
Kubernetes is the technology supported by the majority of cloud providers for orchestrating containerized applications. Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. It provides a highly flexible and scalable environment for running applications in containers.
Many cloud providers offer managed Kubernetes services, allowing users to easily deploy and manage Kubernetes clusters without the need to handle the underlying infrastructure complexities. These managed Kubernetes services ensure high availability, scalability, and seamless integration with other cloud services.
Vagrant, Ansible, and Terraform are also important tools in the realm of cloud computing and automation, but they are not primarily focused on container orchestration. Vagrant is used for creating and configuring lightweight, portable development environments, Ansible is used for configuration management and automation, and Terraform is used for infrastructure provisioning and management. While these tools have their own purposes and use cases in cloud deployment and automation, Kubernetes specifically addresses the orchestration needs of containerized applications, making it the go-to choice for most cloud providers in this context.
An IT team is currently implementing a custom software platform to address some key needs of the company. Which of the following is considered a functional requirement?
A. Identifying the purpose of the proposed system
B. Identifying the users of the proposed system
C. Identifying the development methodology
D. Identifying the technology stack of the proposed system
A functional requirement in the context of software development specifies what the system should do, its functions, and how it should behave under various conditions. Let’s examine the options provided:
A. Identifying the purpose of the proposed system - This is not a functional requirement. It’s about understanding the overall goal or objective of the system, which guides the development process.
B. Identifying the users of the proposed system - This is more related to understanding the stakeholders and users of the system. It’s essential for gathering requirements, but it’s not a functional requirement by itself.
C. Identifying the development methodology - This is not a functional requirement. It’s about selecting an approach or methodology for how the software will be developed.
D. Identifying the technology stack of the proposed system - This can be considered a functional requirement. It defines what technologies and tools the system will use to achieve its functions. For instance, specifying that the system will use a specific programming language, database, frameworks, etc., to perform certain functions would be a functional requirement.
Therefore, option D (Identifying the technology stack of the proposed system) is the one that aligns with the concept of a functional requirement.
A server on the network is unreachable. What is the best method to verify connectivity between your computer and the remote server?
A. lookup
B. find
C. ping
D. netstat
C. ping
The best method to verify connectivity between your computer and a remote server is to use the “ping” command. The “ping” command is a network diagnostic tool that sends ICMP (Internet Control Message Protocol) echo request packets to the target server and waits for responses. If the server is reachable and responsive, you’ll receive a series of responses indicating the round-trip time.
To use the “ping” command, open a command prompt or terminal and type:
```bash
ping <server_address_or_ip>
~~~</server_address_or_ip>
Replace <server_address_or_ip>
with the actual address or IP of the remote server you want to test.
Here’s a brief explanation of the other options:
A. lookup: The “lookup” command is not a standard networking command. It’s likely a typo or misunderstanding, as the correct term is usually “nslookup,” which is used for querying DNS (Domain Name System) to obtain domain name or IP address information.
B. find: The “find” command is used in various operating systems to search for files and directories based on specific criteria. It’s not related to network connectivity testing.
D. netstat: The “netstat” command displays network-related information such as network connections, routing tables, and network interface statistics. It can provide useful information about the local system’s network connections but doesn’t directly test connectivity to a remote server.
A company’s IT associate lists the contents of a directory and sees this line:
-rwsr-x–x 2 bob sales 2047 Oct 10 09:44 sales-report
What happens when Alice from the accounting team tries to execute this file?
A. The script executes using Bob’s account.
B. The script executes, but Alice cannot see the results.
C. The script executes and Bob is notified.
D. The script fails to execute; Alice is not on the sales team.
A. The script executes using Bob’s account.
In the given scenario, the file “sales-report” has the setuid (suid) permission set for the owner, Bob. The “s” in the permissions -rwsr-x--x
indicates the setuid bit is set. When the setuid permission is set on an executable file, it allows any user who runs the file to have the permissions of the owner of the file during its execution.
Since Alice executes the file, which has the setuid bit set and is owned by Bob, the script will execute using Bob’s account, essentially inheriting Bob’s permissions and access rights during execution. This is a security mechanism that allows certain programs to execute with elevated privileges or access levels even when run by a regular user.
A software development team uses a single physical server for testing the latest code in multiple environments: development, pre-production, and production.
What is the recommended approach to maintain the basic security of these environments?
A. Assign different developers on the team to work on test, pre-prod, and prod code.
B. Implement peer review for all the changes deployed into any of the environments.
C. Develop and deploy each environment with its own set of software tools.
D. Use different user/group IDs for deploying and running workload in each environment.
D. Use different user/group IDs for deploying and running workload in each environment.
Using different user/group IDs for deploying and running workloads in each environment is a recommended approach to maintain the basic security of multiple environments (development, pre-production, and production) on a shared server. This practice helps in segregating access and permissions for each environment, reducing the risk of unauthorized access or unintended actions in a particular environment affecting others.
Here’s a brief explanation of the other options:
A. Assign different developers on the team to work on test, pre-prod, and prod code: While assigning different developers can provide some level of separation, it may not be sufficient for security purposes. It’s essential to ensure that even if a person has access to multiple environments, their access and actions are controlled and restricted appropriately.
B. Implement peer review for all the changes deployed into any of the environments: Peer review is an important practice for code quality and correctness, but it doesn’t directly address security concerns associated with running different environments on a shared server.
C. Develop and deploy each environment with its own set of software tools: While deploying each environment with its own set of software tools can be beneficial for customization and control, it may not inherently provide security against unauthorized access or actions.
Option D, using different user/group IDs, is the most effective way to ensure a level of isolation and security between the environments on the shared server.
Which utility is used to create public and private key pairs for SSH authentication?
A. adduser
B. ssh-keygen
C. keygen
D. ssh
B. ssh-keygen
The ssh-keygen
utility is used to create public and private key pairs for SSH (Secure Shell) authentication. SSH keys are a pair of cryptographic keys that can be used to authenticate to an SSH server as an alternative to password-based logins. The ssh-keygen
command generates these keys, allowing secure authentication without the need for passwords.
Here’s a brief explanation of the other options:
A. adduser: The adduser
command is used to add a new user to the system. It is not used for generating SSH key pairs.
C. keygen: “keygen” is not a standard command in Linux or SSH. The correct command for creating SSH key pairs is ssh-keygen
.
D. ssh: The ssh
command is used to initiate an SSH connection to a remote server. It is not used for generating SSH key pairs.
What does LVM stand for?
A. Logical Virtualization Manager
B. Linux Volume Manager
C. Logical Volume Manager
D. Linux Virtualization Manager
What does LVM stand for?
A. Logical Virtualization Manager
B. Linux Volume Manager
C. Logical Volume Manager
D. Linux Virtualization Manager
Encryption that uses both a private key and public key is known as what?
A. Key Pair Encryption (symmetric cryptography)
B. HMAC Cryptography (hash based message authentication)
C. Public Key Cryptography (asymmetric cryptography)
D. DPE (dual-phased hybrid encryption)
C. Public Key Cryptography (asymmetric cryptography)
Encryption that uses both a private key and a public key is known as Public Key Cryptography, which is a form of asymmetric cryptography. In this system, a pair of keys is used: a public key for encryption and a corresponding private key for decryption. Messages encrypted with the public key can only be decrypted with the corresponding private key, and vice versa.
Here’s a brief explanation of the other options:
A. Key Pair Encryption (symmetric cryptography): This term is not commonly used in the context of encryption. Symmetric cryptography typically involves using a single key for both encryption and decryption.
B. HMAC Cryptography (hash-based message authentication): HMAC (Hash-based Message Authentication Code) is a mechanism for verifying the integrity and authenticity of a message. It is not directly related to encryption with both a private and public key.
D. DPE (dual-phased hybrid encryption): “DPE” is not a standard term in the context of encryption. Hybrid encryption is a common term used to describe a combination of symmetric and asymmetric encryption, but “DPE” is not a standard abbreviation for this concept.
An IT associate would find the log files for syslog in which of the following directories?
A. /var/log
B. /usr/local/logs
C. /home/logs
D. /etc/logs
A. /var/log
The log files for the syslog service on a Linux system are typically found in the /var/log
directory. The syslog service, which is responsible for system logging, stores its log files in various files within the /var/log
directory to track system events, messages, and other important information.
Here’s a brief explanation of the other options:
B. /usr/local/logs: This is not a standard location for syslog logs. The standard log directory is /var/log
.
C. /home/logs: This is not a standard location for syslog logs. The standard log directory is /var/log
.
D. /etc/logs: The /etc
directory is typically used for configuration files, not for storing log files. Standard practice is to store log files in /var/log
.
Which of the following deployment environments is accessed by customers/end-users in a live or real-time fashion?
A. Production
B. Runtime
C. Staging
D. Website
A. Production
The “Production” deployment environment is the one accessed by customers and end-users in a live or real-time fashion. In a production environment, the software, applications, or services are fully developed, tested, and made available to end-users for regular usage. It’s the live and operational environment where users access the final, stable version of the product or service.
Here’s a brief explanation of the other options:
B. Runtime: “Runtime” generally refers to the period during which a program or application is executing. It is not a specific deployment environment.
C. Staging: The “Staging” environment is a pre-production environment used for testing and validating new features, updates, or changes before they are moved to the production environment.
D. Website: “Website” is not a deployment environment; it is the platform or interface through which users access services or information online. The website could be hosted in either a staging or production environment.
Which port is normally required to be open for secure remote interactive shell access to Linux systems?
A. 443/tcp
B. 23/tcp
C. 22/tcp
D. 25/tcp
C. 22/tcp
Port 22 is the standard port used for secure remote interactive shell access to Linux systems via the SSH (Secure Shell) protocol. SSH provides a secure way to access and manage a remote system’s command-line interface, allowing for secure logins and encrypted communication between the client and the server.
Here’s a brief explanation of the other options:
A. 443/tcp: Port 443 is used for HTTPS (HTTP Secure) communication, typically used for secure web browsing. It’s not the default port for SSH.
B. 23/tcp: Port 23 is used for Telnet, an older and less secure protocol for remote shell access. Telnet is not recommended for secure communication due to its lack of encryption.
D. 25/tcp: Port 25 is used for SMTP (Simple Mail Transfer Protocol), which is used for email communication. It’s not related to remote shell access.
What is the underlying technology that allows containers to be restricted to defined limits for system resource usage such as CPU, memory, and network bandwidth?
A. climits
B. UnionFS
C. Namespaces
D. cgroups
D. cgroups
The underlying technology that allows containers to be restricted to defined limits for system resource usage such as CPU, memory, and network bandwidth is called cgroups (control groups). Cgroups is a Linux kernel feature that allows the allocation of resources and setting of limits for processes and groups of processes, which is crucial for the proper management and control of containerized applications.
Here’s a brief explanation of the other options:
A. climits: “climits” is not a standard or recognized term related to containerization or resource management.
B. UnionFS: UnionFS (Union File System) is a filesystem service for Linux that allows files and directories to be transparently overlaid onto one another, but it is not directly related to resource limiting in containers.
C. Namespaces: Namespaces are a Linux kernel feature that provides process isolation, allowing processes to have their own view of the system, including their own process IDs, network stack, filesystem mounts, and more. While namespaces are a critical part of containerization, they are not primarily focused on resource limiting.
Which option will cause ls to display hidden files and folders?
A. ls -v
B. ls -l
C. ls -a
D. ls -t
C. ls -a
The option -a
with the ls
command will display hidden files and folders. Hidden files and directories in Linux start with a dot (.), and the -a
option stands for “all,” causing ls
to show all entries, including hidden ones.
Here’s a brief explanation of the other options:
A. ls -v: The -v
option with ls
(verbose) displays additional information for each file, but it does not specifically show hidden files.
B. ls -l: The -l
option with ls
(long format) displays detailed information for each file, including permissions, ownership, size, and more, but it does not specifically show hidden files.
D. ls -t: The -t
option with ls
(time) sorts files by modification time, with the most recently modified files listed first. It does not specifically show hidden files.
In which file are system and user account passwords stored?
A. /etc/passwd
B. /etc/login.defs
C. /etc/shadow
D. /etc/secure
C. /etc/shadow
In Linux systems, the user account passwords (or more accurately, password hashes) are stored in the file /etc/shadow
. This file is readable only by the superuser (root) to enhance security.
Here’s a brief explanation of the other options:
A. /etc/passwd: The /etc/passwd
file contains basic user account information, including usernames, user IDs, group IDs, home directories, and shell information. However, it does not store password information; that is stored in /etc/shadow
.
B. /etc/login.defs: The /etc/login.defs
file contains system-wide configuration for user authentication and password policies, but it does not store individual user passwords.
D. /etc/secure: “secure” is not a standard file related to password storage on Linux systems. Typically, sensitive information like passwords is stored in /etc/shadow
.