- Home
- Server Administration
- LPIC-1 Linux Administrator 102
26.
What types of files might you expect to find in /etc/skel? (Select three.)
- A.A copy of the /etc/shadow file
- B.An empty set of directories to encourage good file management practices
- C.A README or similar welcome file for new users
- D.A starting .bashrc file
- E.The RPM or Debian package management database
- Answer & Explanation
- Report
Answer : [B, C, D]
Explanation :
Explanation :
Files in /etc/skel are copied from this directory to new users’ home directories by certain account-creation tools. Thus, files you want in all new users’ home directories should reside in /etc/skel. Options B, C, and D all describe reasonable possibilities, although none is absolutely required. Including a copy of /etc/shadow in /etc/skel (option A) would be a very bad idea, because this would give all users access to all other users’ encrypted passwords, at least as of the moment of account creation. You wouldn’t likely find package management databases (option E) in /etc/skel, since users don’t need privileged access to this data, nor do they need individualized copies of it. |
27.
What would a Linux system administrator type to remove the nemo account and its home
directory?
- A.userdel nemo
- B.userdel -f nemo
- C.userdel -r nemo
- D.rm -r /home/nemo
- E.usermod -D nemo
- Answer & Explanation
- Report
Answer : [C]
Explanation :
Explanation :
The userdel command deletes an account, and the -r option to userdel (option C) causes it to delete the user’s home directory and mail spool, thus satisfying the terms of the question. Option A deletes the account but leaves the user’s home directory intact. Option B does the same; the -f option forces account deletion and file removal under some circumstances, but it’s meaningful only when -r is also used. Option D’s rm command deletes the user’s home directory (assuming it’s located in the conventional place, given the username) but doesn’t delete the user’s account. Option E’s usermod command can modify accounts, including locking them, but it can’t delete accounts. Furthermore, the -D option to usermod is fictitious. |
28.
Which of the following system logging codes represents the highest priority?
- A.info
- B.warning
- C.crit
- D.debug
- E.emerg
- Answer & Explanation
- Report
Answer : [E]
Explanation :
Explanation :
The emerg priority code (option E) is the highest code available and so is higher than all the other options. (The panic code is equivalent to emerg but isn’t one of the options.) From highest to lowest priorities, the codes given as options are emerg, crit, warning, info, and debug. |
29.
Which of the following configuration files does the logrotate program consult for its settings?
- A./etc/logrotate.conf
- B./usr/sbin/logrotate/logrotate.conf
- C./usr/src/logrotate/logrotate.conf
- D./etc/logrotate/.conf
- E.~/.logrotate
- Answer & Explanation
- Report
Answer : [A]
Explanation :
Explanation :
The logrotate program consults a configuration file called /etc/logrotate.conf (option A), which includes several default settings and typically refers to files in /etc/ logrotate.d to handle specific log files. The remaining options are all fictitious, at least as working log files for logrotate. |
30.
You want to create a log file entry noting that you’re manually shutting down the system to
add a new network card. How might you create this log entry, just prior to using shutdown?
- A.dmesg -l “shutting down to add network card”
- B.syslog shutting down to add network card
- C.rsyslogd “shutting down to add network card”
- D.logger shutting down to add network card
- E.wall “shutting down to add network card”
- Answer & Explanation
- Report
Answer : [D]
Explanation :
Explanation :
The logger utility can be used to create a one-time log file entry that you specify. In its simplest form, it takes no special arguments, just a message to be inserted in the log file, as in option D. The dmesg utility in option A is used to review the kernel ring buffer; it doesn’t create log file entries. Option B’s syslog command isn’t a Linux user-mode command, although it is the name of the logging system generically, as well as a programming language command name. Option C’s rsyslogd is the name of one of several system logging daemons; it maintains the system log but isn’t used to manually insert log entries. Option E’s wall command writes a message to all users’ terminals. Although you might want to use wall prior to shutting down so as to alert users of this fact, it won’t create a log file entry as the question requires. |