You've encountered a script where a loop is expected to run five times, but it runs indefinitely. Which common debugging approach would you use to inspect the condition causing the loop to behave this way?

  • Insert echo statements
  • Set a timeout
  • Use set -x
  • Add more loops
To inspect the condition causing an infinite loop, you can insert echo statements within the loop to print relevant variables or check the loop counter. This allows you to understand what's happening at each iteration and identify the source of the issue. Debugging with echo statements is a common and effective approach for troubleshooting loops.

You're setting up a Linux server in an enterprise where user credentials are managed centrally. To ensure that Linux users can log in using their central credentials, which service or protocol should the Linux server support?

  • LDAP
  • RADIUS
  • Kerberos
  • TACACS+
To allow Linux users to log in using central credentials, you should support LDAP (Lightweight Directory Access Protocol). LDAP is a widely used protocol for centralizing user authentication and directory services, making it a suitable choice in enterprise environments.

Which directory in Linux contains system configuration files?

  • /etc
  • /home
  • /opt
  • /var
The /etc directory in Linux contains system configuration files. These files store configuration settings for various system components and applications.

Which command in a shell script is used to break out of a loop prematurely?

  • break
  • continue
  • exit
  • return
The break command in a shell script is used to break out of a loop prematurely. When encountered, it immediately exits the loop and continues with the next statement after the loop. This is handy for situations where you want to exit a loop based on a specific condition.

A colleague is trying to access a directory shared via NFS from a Linux machine but is facing permission issues. Which file on the server would you check to verify the permissions and access for the shared directory?

  • /etc/exports
  • /etc/fstab
  • /etc/nfsd.conf
  • /etc/permissions
To verify permissions and access for a directory shared via NFS, you would check the /etc/exports file on the NFS server. This file specifies the directories that are shared and the permissions granted to clients.

In the context of user authentication, what is a "salt" used for?

  • Adding randomness to a password before hashing
  • Encrypting user passwords
  • Verifying the user's identity
  • Generating secure tokens
In user authentication, a "salt" is used to add randomness to a password before hashing. This helps protect against common attacks like rainbow table attacks and ensures that even the same password will have different hash values due to the unique salt.

In Docker, a _________ is a lightweight, stand-alone, executable software package that includes everything needed to run a piece of software.

  • Container
  • Image
  • Virtual Machine
  • Repository
In Docker, an "image" is a lightweight, stand-alone, executable software package that includes everything needed to run a piece of software. Docker containers are created from these images, allowing you to run applications in an isolated environment.

The Linux tool __________ allows administrators to view and set system and kernel parameters at runtime.

  • sysctl
  • top
  • ls
  • nano
The Linux tool sysctl allows administrators to view and set system and kernel parameters at runtime. It's a powerful utility for fine-tuning and configuring various aspects of the Linux kernel to optimize performance and behavior.

When creating a case statement in Bash, each case is ended with the word ________.

  • esac
  • end
  • done
  • fi
When creating a case statement in Bash, each case is ended with the word esac. The esac keyword marks the end of the case statement, and it's used to close the case block.

Which command is commonly used for securely copying files between remote systems?

  • scp
  • ls
  • cat
  • mv
The scp (secure copy) command is commonly used for securely copying files between remote systems. It uses SSH to encrypt the data during the transfer, ensuring security.