Difference between revisions of "Lab 4 Warnings / Debrief"
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
= Preparing for Lab 4= | = Preparing for Lab 4= | ||
− | == | + | == Managing user Accounts == |
=== The /etc/passwd file === | === The /etc/passwd file === | ||
Line 31: | Line 31: | ||
The '''/etc/skel''' directory can contain files (as a template) for newly created user accounts to have. This helps to automate the task of continually creating new accounts without having to create the same default files after account creation. | The '''/etc/skel''' directory can contain files (as a template) for newly created user accounts to have. This helps to automate the task of continually creating new accounts without having to create the same default files after account creation. | ||
+ | === The /etc/group File === | ||
+ | The /etc/group file is used to store groups which users can belong. | ||
+ | This is important for setting permissions for files and directories for allowing or denying access for <u>same</u> or <u>other</u> group members (eg. chmod command) | ||
+ | |||
+ | This file consists of several fields: | ||
+ | |||
+ | :#''' groupname | ||
+ | :#'''Password''': (generally not used) | ||
+ | :#'''Group ID (GID)''' | ||
+ | :# '''Group List''' It is a list of user names of users who are members of the group (separated by commas) | ||
+ | |||
+ | === Managing Groups === | ||
+ | |||
+ | Just as with user accounts, a Linux system administrator will be required to manage groups on an on-going basis. | ||
+ | For example, users are added to a default group, but users can also be added (appended) to the newly-added supplemental groups | ||
+ | in the /etc/group file. | ||
+ | |||
+ | Various Linux commands for group management includes: | ||
+ | |||
+ | |||
+ | :* '''groupadd''' - Creates a group in /etc/group file (the option -g assigns a gid for the group) | ||
+ | :* '''groupdel''' - Removes an existing group contained in the /etc/group file | ||
+ | :* '''usermod -a -G [groupname] user''' - Modifies the /etc/group file to add or "append" users to a "supplemental" group name | ||
+ | |||
+ | |||
+ | == Managing System Services == | ||
+ | |||
+ | === Listing Services === | ||
+ | |||
+ | |||
+ | === Starting / Stopping / Restarting Services === | ||
+ | |||
+ | |||
+ | === Enabling / Disabling Services === | ||
== Common Mistakes / Warnings == | == Common Mistakes / Warnings == |
Latest revision as of 07:26, 3 November 2015
Contents
Preparing for Lab 4
Managing user Accounts
The /etc/passwd file
The /etc/passwd file contains user account information for the Linux system. The password field is encrypted, but the password hash is view-able and can be edited by root in the /etc/shadow file. This only allows the root to be able to read the /etc/shadow file in order to further secure the Linux system upon user login.
It is comprised of several fields:
- Username
- Password: An x character indicates that encrypted password is stored in /etc/shadow file.
- User ID (UID)
- Group ID (GID)
- User Information (eg. user name)
- Default Home directory
- Default shell
Managing User Accounts
A Linux system administrator will be required to manage user accounts on an on-going basis.
Various Linux commands for user account management includes:
- useradd - Creates a user account in /etc/passwd file (the option -m creates a home directory for the user)
- userdel - Removes an existing user account contained in the /etc/passwd file (the option -r removes the user's home directory as well)
- usermod - Modifies fields contained in the /etc/passwd file for that particular username
The /etc/skel directory can contain files (as a template) for newly created user accounts to have. This helps to automate the task of continually creating new accounts without having to create the same default files after account creation.
The /etc/group File
The /etc/group file is used to store groups which users can belong. This is important for setting permissions for files and directories for allowing or denying access for same or other group members (eg. chmod command)
This file consists of several fields:
- groupname
- Password: (generally not used)
- Group ID (GID)
- Group List It is a list of user names of users who are members of the group (separated by commas)
Managing Groups
Just as with user accounts, a Linux system administrator will be required to manage groups on an on-going basis. For example, users are added to a default group, but users can also be added (appended) to the newly-added supplemental groups in the /etc/group file.
Various Linux commands for group management includes:
- groupadd - Creates a group in /etc/group file (the option -g assigns a gid for the group)
- groupdel - Removes an existing group contained in the /etc/group file
- usermod -a -G [groupname] user - Modifies the /etc/group file to add or "append" users to a "supplemental" group name
Managing System Services
Listing Services
Starting / Stopping / Restarting Services
Enabling / Disabling Services
Common Mistakes / Warnings
Preparing for Lab Sign-Off
In order to properly complete your lab and move to the next lab, you must have your instructor "sign-off" on your lab
- Each "signed-off" lab (before due date) is worth 1% of your final grade.
- Signing-off on labs help to spot errors that can cause problems with future labs.
- Do you ask the instructor what to check for! Read at the bottom of the lab the requirements, and have all proof available for instructor to view at same time.
- Failing to be prepared and asking instructor what to check when assignment is mark will result in deduct of marks!
- For example, open multiple terminals with command results. If properly set-up ahead of sign-off, the process should only take instructor approx 20 seconds to sign-off your lab.
- If you do not have your lab-logbook, you MUST show your work and your lab log-book to your instructor for sign-off in the next class. This may cause a late penalty if past the required due date.