102-500 Sample Questions & Answers
Networking fundamentals edge out the rest slightly, alongside administrative tasks like user accounts and job scheduling, maintaining system time and logging, host security and encryption, shell scripting, and X11 with graphical desktops and accessibility.
Launch the full 102-500 simulator →Showing 10 of 20 free samples.
- Question 1
Which of the following entries in /etc/syslog.conf writes all mail related events to the file /var/log/maillog and sends all critical events to the remote server logger.example.com?
Show answer & explanation
Correct answer: D
The correct syslog.conf syntax uses "mail.*" to capture all mail facility messages at any priority level, "/var/log/maillog" as the file destination, and "[email protected]" to send critical mail events to a remote syslog server. The @ symbol designates remote logging, and the asterisk wildcard captures all priority levels. Other options have syntax errors like missing dots, incorrect wildcards, or malformed remote server specifications.
- Question 2
Which of the following commands is used to rotate, compress, and mail system logs?
Show answer & explanation
Correct answer: A
The logrotate command is used to rotate, compress, and optionally mail system logs to prevent log files from growing too large. It reads configuration from /etc/logrotate.conf and /etc/logrotate.d/ directory to manage log file rotation schedules, compression settings, and cleanup policies. Other tools like rsyslog handle log collection, but logrotate specifically manages log file maintenance and archival.
- Question 3
What is the purpose of the iconv command?
Show answer & explanation
Correct answer: C
The iconv command converts text files from one character encoding to another, such as converting from ISO-8859-1 to UTF-8 or between different national character sets. This is essential for handling international text data and ensuring proper display of non-ASCII characters. It does not compress files, change file permissions, or perform other file operations - only character set conversion.
- Question 4
If neither cron.allow nor cron.deny exist in /etc/, which of the following is true?
Show answer & explanation
Correct answer: E
When neither /etc/cron.allow nor /etc/cron.deny exist, the default behavior varies by system but typically only root can use cron services for security reasons. Most Linux distributions follow the principle of deny-by-default when access control files are missing. The /etc/crond.conf file does not control user access to cron - that is managed specifically by the allow/deny files or system defaults when they are absent.
- Question 5
What is true about the file .profile in a user’s home directory?
Show answer & explanation
Correct answer: E
The .profile file in a user home directory must be readable by its owner to be executed by the shell during login. While it should not be writable by others for security reasons, it does not need to be readable only by the owner - it can be readable by the group and others without compromising security. The key requirement is that the user can read it and others cannot modify it. Executable permission is not required for shell profile files.
- Question 6
Which of the following configuration files should be modified to globally set shell variables for all users?
Show answer & explanation
Correct answer: A
The /etc/profile file should be modified to globally set shell variables for all users, as it is executed by login shells for all users during the login process. This file contains system-wide environment variable settings and is the standard location for global shell configuration. Files like /etc/bashrc affect only bash users, ~/.profile affects only individual users, and /etc/environment is used by some systems but /etc/profile is the most universally supported location.
- Question 7
The presence of what file will temporarily prevent all users except root from logging into a system? (Specify the full name of the file, including path.)
Show answer & explanation
Correct answer: A
The /etc/nologin file temporarily prevents all non-root users from logging into the system when it exists. When this file is present, the login process displays its contents (if any) to users attempting to login and then denies access. This is commonly used during system maintenance. The file /sbin/nologin is actually a shell that denies login when used as a user shell, but the question asks about temporarily preventing all users from logging in.
- Question 8
What information is provided by the echo $$ command?
Show answer & explanation
Correct answer: A
The command "echo 77150" displays the process ID (PID) of the current shell process. The 77150 variable is a special shell variable that contains the PID of the shell itself. This is useful for scripts that need to identify their parent shell process, create unique temporary files, or manage process relationships. Other special variables include 0 for the last background process PID and 0 for the exit status of the last command.
- Question 9
What output does the command seq 10 produce?
Show answer & explanation
Correct answer: E
The "seq 10" command produces output of numbers 1 through 10, with one number per line. The seq command generates sequences of numbers, and when given a single argument, it starts from 1 and counts up to that number. This is useful in shell scripts for creating loops or generating numbered lists. The command can also take start, increment, and end values for more complex sequences.
- Question 10
Which if the following tools, used for DNS debugging, reports not only the response from the name sever but also details about the query?
Show answer & explanation
Correct answer: C
The dig (Domain Information Groper) command is the DNS debugging tool that reports not only the response from the name server but also detailed information about the query itself, including query time, server contacted, and query flags. Unlike nslookup which provides basic lookup functionality, dig shows comprehensive query details and response analysis. Host and ping provide basic name resolution but lack the detailed debugging information that dig provides.
Ready for the real thing?
The full 102-500 simulator has every exam-style question, timed mode, and instant scoring.