Tuesday, March 1, 2016

Week 20: Day 052 - Managing Users and Groups


Hello, today I will give you a summary of what I learned about managing users and groups. Most of this was done through my own doing on terminal, with some help from the textbook. Let's see what I know:

#1 - Local User Accounts

To create a local user account you need to sudo or get into root by doing "sudo su".

To make a new user type "useradd (name of user)".

To identify which user you are type "whoami".

To edit the sudoers file type "visudo".

To get into the configuration files do "vipw"

To change the password do "passwd (name of user)", usually in sudo.

To remove users do "userdel -r (name of user)".
------------------------------------------------------------------------------------------------------------
Ideal Example: "passwd -n 30 -w 3 -x 90 linda", sets the password for user linda to a minimal usage period of 30 days and an expiry after 90 days, where a warning is generated 3 days before expiry.------------------------------------------------------------------------------------------------------------

#2 - Local Groups

To create a local group you must use the command "vigr" or "groupadd".

To customize the name of the group when creating it "groupadd -g"

To make a user a part of an administrative group do "usermod -aG wheel user".

To make sure that a user is in a certain group type "id (name of user)".

To modify properties of the group "groupmod".
------------------------------------------------------------------------------------------------------------
Ideal Example: Type "groupadd sales" followed by "groupadd account" to add groups with the names sales and account. Then "usermod -aG sales linda" to add Linda to that group.
------------------------------------------------------------------------------------------------------------

#3 - Lightweight Directory Access Protocol (LDAP)

This is hierarchical and organized like DNS.

To configure this to CentOS/RHEL 7, there are several options:

- "authconfig" will let you configure through command line.
- "authconfig-tui" will give let you configure with a Text User Interface.
- "authconfig-gtk" will give you a GUI utility to configure it.

To connect to an LDAP server you must:

- Setup a hostname resolution on your server.
- The IP "192.168.122.200" is used for LDAP

You will be given this in the Text User Interface version, type this stuff in:











Click "OK" and you're done! Finally:

Review Questions

1. What is the UID of user root?

0

2. What is the configuration file in which sudo is defined?

/etc/sudoers

3. Which command should you use to modify a sudo configuration?

visudo

4. Which two files can be used to define settings that will be used when creating users?
/etc/login.defs

5. How many groups can you create in /etc/passwd?

None

6. If you want to grant a user access to all admin commands through sudo, which group should you make that user a member of?

wheel

7. Which command should you use to modify the /etc/group file manually?

vigr

8. Which two commands can you use to change user password information?

passwd chage

9. What is the name of the file where user passwords are stored?

/etc/shadow

10. What is the name of the file where group accounts are stored?

/etc/group

No comments:

Post a Comment