Chapter 7 Solutions

advertisement
Linux Operations and Administration, ISBN 111103530X
Ch. 7
Solutions-1
Chapter 7 Solutions
Review Questions
1.
Which Linux configuration file can be read only by root and contains users’ encrypted
passwords?
b. /etc/shadow
2.
Which Linux configuration file contains users’ default information, such as the allowed range
of UIDs and GIDs?
c. /etc/login.defs
3.
What is the UID in the line from the following /etc/passwd file?
joe:x:1003:100:Joe Netti:/home/joe:/bin/bash
a. 1003
4.
Which Linux configuration file contains default user account information, such as the user’s
default group and skeleton directory?
d. /etc/default/useradd
5.
Explain the difference between a user’s primary and secondary groups.
Every user must be assigned to at least one group. A user’s primary group is the default group the
user is assigned to when the account is first created and is the group owner of all files the user
creates. Secondary groups are additional groups the user is assigned to.
6.
User accounts don’t need to have an assigned group. True or False?
False
7.
Which command enables an administrator to add a new user account named john with the full
name John Smith as a comment?
d. useradd -c "John Smith" john
8.
Which of the following user parameters can be set in the /etc/default/useradd
configuration file? (Choose all that apply.)
a. The skeleton directory
c. The home directory
9.
Which command enables an administrator to change an existing user’s home directory to
/home/users?
b. usermod -d /home/users nicole
10. Which of the following options displays the groups belonging to the user rob? (Choose all that
apply.)
b. cat /etc/group
c. id rob
11. By default, when an administrator deletes a user account in openSUSE, the home directory
remains. True or False?
True
12. Only the root user can view the /etc/group file. True or False?
Linux Operations and Administration, ISBN 111103530X
Ch. 7
Solutions-2
False
13. Which command does an administrator use to add the user tamie to the group projects?
a. groupmod -A tamie projects
14. Describe the purpose of the skeleton directory.
The skeleton directory contains files copied to the home directory of each new user. It enables an
administrator to ensure that all new users have the same content in their home directories.
15. Which of the following is the process of using an account name with a password to log in to a
system?
b. authentication
16. UIDs and GIDs should be unique on a system. True or False?
True
Activities
Activity 7-1: Creating Users
Step 3: No. Only the root user can view the /etc/shadow file.
Step 5: The password aging controls are as follows:
# Password aging controls (used by useradd):
#
# PASS_MAX_DAYS Maximum number of days a password may be used.
# PASS_MIN_DAYS Minimum number of days allowed between password
changes.
# PASS_WARN_AGE Number of days warning given before a password expires.
#
PASS_MAX_DAYS 99999
PASS_MIN_DAYS 0
PASS_WARN_AGE 7
Activity 7-2: Modifying User Accounts
Step 10: Type chage -m 1 -M 45 -W 3 student2 and press Enter.
Activity 7-3: Groups
Step 3: At this point, no users should be assigned to the students group.
Step 7: File1’s group owner is users, and file2’s group owner is students.
Activity 7-4: YaST User and Group Administration
Step 5: UID = 1003, Home Directory: /home/student3, Login Shell: /bin/bash, Default Group: users
Step 6: By default, the new user gets a warning 7 days before the password expires. The 99999 under the
maximum number of days for the same password means the password never expires.
Linux Operations and Administration, ISBN 111103530X
Ch. 7
Solutions-3
Case Projects
Case Project 7-1: Assigning UIDs
Answers may vary. If students decide they should continue allowing the useradd command to assign
UIDs automatically, they should mention at least the following reasons:

Guarantees that every user will have a unique UID.

Less room for human error.

Takes less time to create the user accounts, so more time can be spent securing the system or
doing other administrative tasks.

Less paperwork. If the IT staff needs to assign UIDs for every user on the system, some type of
database (physical paper or digital) would be necessary to list every user and his or her UID as
well as available UIDs.
If students decide to assign UIDs manually, they should mention at least the following reasons:

Better control over ownership of files. For instance, all users have an UID that’s associated with
ownership of all files they have created. If a user leaves and his or her account is deleted, the
user’s files still remain on the system. If you create a new user who automatically gets the same
UID as the previous user, the new user has access to all the previous user’s files (even if this
wasn’t intended).

Specifying users with a set range of UIDs. For instance, all users in the Math Department can have
an UID range of 500 to 550, and all users in the Science Department can have a range of 550 to
600, and so forth. Project managers and other staff members would have their ranges, too. The
benefit is better control over ownership of files.
Download
Study collections