Administering The System Section 2 Linux 104
Which of the following files is the main configuration file of cron?
/etc/crontab
Which of the following files can be modified to create users in the Linux system?
/etc/passwd
Which of the following files contains a list of all user accounts?
/etc/passwd
Which of the following files is used to store the uid number?
/etc/passwd
The chage command changes the date at which the password of a user account expires. The password aging information is stored in the
/etc/shadow file.
Which file is the configuration file for the systemd Journal System?
/etc/systemd/journald.conf
Which of the following is the default directory for crontab files?
/var/spool/cron
Which of the following defines the facility parameter in the /etc/syslog.conf file?
A type of program that generated the messages to be logged
How might you schedule a script to run once a day on a Linux computer? (Select two.)
Create a user cron job that calls the specified script once a day at a time of your choosing, and install that cron job using crontab. Place the script, or a link to it, in /etc/cron.daily.
Which of the following tasks are most likely to be handled by a cron job? (Select two.)
Finding and deleting old temporary files Monitoring disk partition space status and emailing a report
Each entry in the crontab file ends with which character?
Newline
You've configured one computer (gateway.pangaea.edu) on your five-computer network as an NTP server that obtains its time signal from ntp.example.com. What computer(s) should your network's other computers use as their time source(s)?
Only gateway.pangaea.edu
Each line of the crontab file contains __________ fields.
Six
As root, you type date 12110710. What will be the effect?
The software clock will be set to 7:10 a.m. on December 11 of the current year. The format of the date command's date code is [MMDDhhmm[[CC]YY ][.ss ]]
You want sally, who is already a member of the Production group, also to be a member of the Development group. What is the best way to accomplish this?
Use the usermod -a -G Development sally command.
What commands can be used to add user accounts to a Linux system?
adduser username useradd -c "full name" username useradd username
You're installing Linux on a critical business system. Which of the following programs might you want to add to ensure that a daily backup job is handled correctly?
anacron
List all groups on the system.
cat /etc/group
Search the user named "jandrew" in the /etc/passwd file
cat /etc/passwd | grep jandrew
Verify account aging information such as expiry date and time.
chage -l jandrew
Verify that user account's aging information such as expiry date.
chage -l john
Configure the password for the "jandrew" user by setting the minimum password age to 3 days, the maximum password age to 60 days, and the number of warning days before expiration to 7 days
chage -m 3 -M 60 -W 7 jandrew
The /etc/skel directory
contains files and directories that are automatically copied over to a new user's home directory, if such users are created by the useradd command. It allows a system administrator to create a default home directory for all new users on the computer or network and make sure that all users begin with the same settings or environment.
Your manager has asked that you configure logrotate to run on a regular, unattended basis. What utility/feature should you configure to make this possible?
cron
Which of the following commands is used to set the system time in the Linux operating system?
date
Add an existing user named "manager" to the "product" group.
gpasswd -a manager product
Add "salesman" to the "sales" group.
gpasswd -a salesman sales
Remove "manager" from the "product" group.
gpasswd -d manager product
Create a new group named "product".
groupadd product
Create a group named "sales".
groupadd sales
Delete the "product" group.
groupdel product
Which of the following commands is used to modify a group?
groupmod
Verify group membership for user "john".
groups john
Verify that user "salesman" is added in the group "sales".
groups salesman
The logrotate command
is used for automatic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large.
Execute the command to list the long file listing and determine the current time zone by looking at the file to which localtime links.
ls -l /etc/localtime
Which of the following commands set the date and time via NTP?
ntpdate
The ntpdate command is used to
set the local date and time by polling the Network Time Protocol (NTP) server(s) given as the server arguments to determine the correct time. The syntax of the ntpdate command is: ntpdate [-46bBdqsuv] [-a key] [-e authdelay] [-k keyfile] [-o version] [-p samples] [-t timeout] server [...]
Which of the following files is the main configuration file of the syslogd daemon?
syslog.conf
The sysklogd command provides two system utilities, which provide support for system logging and kernel message trapping. As this utility supports both Internet and UNIX domain sockets, it also supports both local and remote logging. The two system utilities are
syslogd and klogd. Every logged message contains at least a time and a hostname field and sometimes a program name field as well.
Create a user named "salesman" and set the login shell as /bin/bash
useradd -s /bin/bash salesman
Add a user name "john" in "sales" group with following details: o User id must be 1001. o The account must be automatically deactivated on 2015/12/01. o The login shell must be /usr/bin/zsh.
useradd -u 1001 -g sales -e 2015/12/01 -s /usr/bin/zsh john; The -u option sets the user id for new users. The -g option is used to set the group name or gid. To automatically deactivate the account, use the -e option with date, which should be in YYYY/MM/DD format. For setting the user's login shell, you can use the -s option.
Delete the "salesman" account (the home directory and the mail spool must also be deleted).
userdel -r salesman
Execute the command to delete a user account named "sally" along with a home directory.
userdel -r sally
Which of the following commands is used to change the group of a Linux user?
usermod