Open main menu

CDOT Wiki β

Changes

OPS235 Lab 4 Braille

8,715 bytes added, 14:02, 1 March 2012
Created page with 'Category:OPS235Category:OPS235 Labs{{Admon/caution|Braille Only|If you are not using a braille reader, please use OPS235 Lab 4 instead of this lab.}} = User & Gr…'
[[Category:OPS235]][[Category:OPS235 Labs]]{{Admon/caution|Braille Only|If you are not using a braille reader, please use [[OPS235 Lab 4]] instead of this lab.}}

= User & Group Management=

==Introduction==

* In this lab, you will learn how to manage (add, delete, modify) user accounts on your Fedora systems. You will also learn how to create and maintain groups to allow users to share and protect data.

==Objectives==

#Learn how to add and remove and modify user accounts.
#Learn how to create and manage groups.

==Linux Command Online Reference==
Each Link below displays online manpages for each command (via [http://linuxmanpages.com/ http://linuxmanpages.com]):

* [http://linux.die.net/man/5/passwd /etc/passwd File]
* [http://www.linuxhowtos.org/Tips%20and%20Tricks/using_skel.htm /etc/skel File]
* [http://www.cyberciti.biz/faq/understanding-etcgroup-file/ /etc/group File]
*[http://linuxmanpages.com/man8/useradd.8.php useradd]
*[http://linuxmanpages.com/man8/userdel.8.php userdel]
*[http://linuxmanpages.com/man8/usermod.8.php usermod]
*[http://linuxmanpages.com/man8/groupadd.8.php groupadd]
*[http://linuxmanpages.com/man8/groupdel.8.php groupdel]
*[http://linuxmanpages.com/man1/chmod.1.php chmod]

==Resources on the web==

Additional links to tutorials and HOWTOs:

:* [http://www.itwire.com/content/view/14446/53/ UID and GID explained]

= User/Group Management =

== Investigation 1: The /etc/passwd file ==

'''Perform this investigation on the VM named ''<u>fedora1</u>''.'''

# Read about the file: http://linux.die.net/man/5/passwd
# Now look at the contents of the '''/etc/passwd''' file.
# Make note of the contents of that file, and make certain and record in your lab log-book the information that each field contains.
# Why do you think there are so many users?
# Look at the names of the users. What do you think these user names represent? Are they people?
# What is the numeric user ID (UID) of the root user?
# The user IDs of real users (people) are different from the user IDs of system accounts. What is the pattern?

'''Answer the Investigation 1 observations / questions in your lab log book.'''

== Investigation 2: Adding users ==

'''Perform this investigation on the VM named ''<u>fedora1</u>''.'''

# Read the man page for the '''useradd''' command.
# Create a new user account for each of your pod-mates, using their learn account name as a user name. Give each user a password. If you don't have any pod-mates at the time you do this lab, create dummy users, and test access from another computer.
# Use the grep command to obtain information for each of the newly created users within the '''/etc/passwd''' file.
#* What is the home directory of each user?
#* What group is each user in?
#* What else do you know about each user?
#* Where are the passwords stored?
# Look at the man page for /etc/shadow using the command man 5 shadow
#* Grep the /etc/shadow file for each of the new users.
#* Make note of this information.
#* What is the purpose of the /etc/shadow file?
# Create two new dummy users, ops235_1 and ops235_2.
# Investigate the home directory of one of your new users.
#* What files are there? Be sure to include hidden files.
#* What do you think these files are used for <span class="plainlinks">?
#* How does the operating system determine which files are created in a new home account? <br />The answer can be found here: http://www.linuxhowtos.org/Tips%20and%20Tricks/using_skel.htm
#* Look at the files (including hidden files) in the template directory referred to in the article. Compare them to what is in a home directory for a new user. What do you notice?
#* Create a new file in this directory with the following command: <code>touch foo</code>
#* Create a new user named foobar, with the option to automatically create a home directory.
#* Look at the contents of foobar's home directory. What do you notice?

<ol>
<li value="7">Boot-up your '''fedora3''' VM.</li>
<li>Create a new user using your '''Matrix''' account user-name.</li>
<li>Issue a command to verify that you have created this user account.</li>
</ol>

'''Answer the Investigation 2 observations / questions in your lab log book.'''

== Investigation 3: Managing Groups ==

{{Admon/note|Use fedora1|Perform these steps in the '''fedora1''' virtual machine.}}

<ol>
<li>Read the man page for the '''groupadd''' and '''groupdel''' commands.</li>
<li>Note which option allows you to set the Group ID number (GID) when you create a new group.</li>
<li>Examine the file <code>/etc/group</code>
<ol type="a">
<li>Which values of GID are reserved for system accounts?</li>
<li>Which values of GID are reserved for non-system user accounts?</li>
<li>What is the lowest available GID number for non-system users?</li>
<li>What is the default group name of a new user?</li>
<li>Add a new group named <code>ops235</code> with a GID of <code>600</code>.</li>
<li>You are angry at some irresponsible users on your system.
<ul>
<li>Add a new group named <code>idiots</code>.</li>
<li>Look at <code>/etc/group</code> and note the GID of idiots.</li>
<li>What GID is given to a new group if you do not specify it?</li>
<li>Your anger has subsided. Delete the <code>idiots</code> group.</li>
<li>Look at <code>/etc/group</code> again and note the change.</li>
</ul>
</li>
</li>
</ol>
</li>
</ol>

Be sure to record your observations in your lab notes.

'''Answer the Investigation 3 observations / questions in your lab log book.'''

== Investigation 4: Deleting users ==

{{Admon/note|Use fedora1|Perform these steps in the '''fedora1''' virtual machine.}}

# Read the man page for the '''userdel''' command. Note which option automatically removes the users home directory when that user is deleted.

# Delete the user ops235_1 using the command <code>userdel ops235_1</code>
# Delete the user <code>ops235_2</code> using the same command with the option which removes the home directory of the user.
# Check the contents of the <code>/home</code> directory. What do you notice?
# Check the contents of the <code>/etc/group</code> directory. What do you notice?

'''Answer the Investigation 4 observations / questions in your lab log book.'''

== Investigation 5: Modifying users ==

'''Perform this investigation on the VM named ''<u>fedora1</u>''.'''

# Read the man page for the '''usermod''' command. Note which options change the user's full name, primary group, supplementary groups, and shell.
# Add each of your new pod mate accounts to the group <code>ops235</code> (in other words, add ops235 to each user as a supplementary group).
# Examine <code>/etc/group</code>. What has changed?
# Experiment with your pod-mate accounts to share and deny access to same group members by creating directories and files, and use the <code>chmod</code> command. How is the <code>/etc/group</code> related to file sharing permissions?
# Use the <code>usermod</code> command to associate each of your pod mates' full name to their user name, as shown in your text. With each change, examine their entries in the <code>/etc/passwd</code> file. What has changed?
# Just for interest, how would you use a graphical utility to modify user account information?
# Be sure to record your observations in your lab notes.

{{Admon/important|Shutdown VMs|It is time to safely shut-down all of your Virtual Machines. Please proceed to '''Completing the Lab'''}}

'''Answer the Investigation 5 observations / questions in your lab log book.'''

= Completing the lab =

{{Admon/important|Time for a new backup!|If you have successfully completed this lab, make a new backup of your virtual machines. Remember to also make a backup of the new second virtual disk drive on ''fedora1'' -- you now have two virtual disks on ''fedora1'', and therefore two image files, and therefore will need two backup files.}}

Arrange proof of the following on the screen:
# Proof of ops235 group entry in <code>/etc/group</code> in '''fedora1''' VM
# Proof of pod-mate user account information in <code>/etc/passwd</code> in '''fedora1''' VM.
# Proof of VM backups.

= Preparing for Quizzes =
# What are the purposes of the following files: <code>/etc/passwd</code>, <code>/etc/shadow</code>, <code>/etc/group</code>?
# Explain the purpose of the <code>/etc/skel</code> directory.
# What do the terms <code>UID</code> and <code>GID </code>represent. What is their purpose?
# List the steps to create a user account on a system.
# List the steps to change user account information on a system.
# List the steps in order for users to share file and directory accounts as "same group members".
# List the steps to remove a user account. What is required to remove a user account's home directory as well?