To change the primary group of a user, the ________ command is utilized.
- usermod -g
- groupmod -g
- chgrp -p
- adduser -G
To change the primary group of a user, the "usermod -g" command is utilized. This command allows you to modify the primary group of an existing user. The "-g" option specifies the new primary group.
The iptables command that allows traffic only from a specific IP address, say 10.0.0.1, to a specific port, say 22, uses the ________ option.
- -s
- -p
- -dport
- -A
The iptables command that allows traffic only from a specific IP address, say 10.0.0.1, to a specific port, say 22, uses the -s (source) option. This option specifies the source IP address from which traffic is allowed.
Which Linux command can be used to enforce password policies and aging?
- passwd
- chage
- pam-config
- usermod
The chage command in Linux is used to enforce password policies and aging. It allows system administrators to set password expiration, minimum and maximum password age, and other security-related settings for user accounts. This helps enhance the security of the system by ensuring that passwords are regularly updated.
For a package manager, what is the significance of the "dependency resolution" process?
- It ensures that all required libraries and packages are installed to support a software package.
- It removes unnecessary packages from the system to save space.
- It creates a backup of installed packages.
- It updates the package manager's metadata.
The "dependency resolution" process in a package manager is significant because it ensures that all required libraries and packages are installed to support a software package. It helps in managing complex software dependencies and makes sure that a package can function properly without missing components.
In a shell script, if you want a loop to execute infinitely, which of the following would be the most appropriate construct?
- while true; do
- for (( ; ; )); do
- until false; do
- do forever;
The most appropriate construct for an infinite loop in a shell script is while true; do. This creates a loop that continues to execute as long as the condition true remains true, effectively resulting in an infinite loop.
The _________ Linux distribution is enterprise-focused and is backed by Red Hat.
- CentOS
- Debian
- Fedora
- Ubuntu
The CentOS Linux distribution is enterprise-focused and is backed by Red Hat. It is known for its stability and long-term support, making it a popular choice for enterprise environments.
Which protocol is primarily used by SSH for secure remote access?
- SSH
- FTP
- HTTP
- Telnet
SSH (Secure Shell) primarily uses the SSH protocol for secure remote access. SSH is a cryptographic network protocol that ensures secure communication over unsecured networks. It provides authentication and encrypted data transfer.
The _________ directory in Linux is typically used for transient or temporary data, often cleared during boot.
- /home
- /opt
- /tmp
- /var
The /tmp directory in Linux is typically used for transient or temporary data. It is often cleared during system boot to ensure it doesn't accumulate unnecessary files and take up space.
You are trying to optimize a Linux server that handles large amounts of data transfer. Which command would you use to monitor disk activity in real-time?
- iotop
- vmstat
- df
- ifconfig
To monitor disk activity in real-time on a Linux server, you can use the iotop command. It displays a list of processes and their disk I/O usage, helping you identify which processes are the most disk-intensive.
To temporarily save iptables rules, one would use the command iptables-save > ________.
- rules.txt
- config.rules
- iptables.conf
- saved-rules
To temporarily save iptables rules, one would use the command iptables-save > **rules.txt**. This command saves the current firewall rules to a file called "rules.txt" for later use or backup.