13,420
edits
Changes
no edit summary
== Part 1: The /etc/passwd file ==
# Look at the <b><code><span style="color:#3366CC;font-size:1.2em;">/etc/passwd </span></code></b> file.
# Make note of the contents of that file.
# Read about the file: http://linux.die.net/man/5/passwd
{{Admon/note|Use centos1|Perform these steps in the '''centos1''' system.}}
# Read the man page for the <b><code><span style="color:#3366CC;font-size:1.2em;">useradd </span></code></b> 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.
# Grep the <b><code><span style="color:#3366CC;font-size:1.2em;">/etc/passwd </span></code></b> file for each of the new users.
#* What is the home directory of each user?
#* What group is each user in?
#* Where are the passwords stored?
# Look at the man page for /etc/shadow using the command man 5 shadow
#* Grep the <b><code><span style="color:#3366CC;font-size:1.2em;">/etc/shadow </span></code></b> file for each of the new users.
#* Make note of this information.
# Create two new dummy users, <b><code><span style="color:#3366CC;font-size:1.2em;">ops235_1 and <b><code><span style="color:#3366CC;font-size:1.2em;">ops235_2</span></code></b>.
# Investigate the home directory of one of your new users.
#* What files are there? Be sure to include hidden files.
#* How does the operating system determine which files are created in a new home account? 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: <b><code><span style="color:#3366CC;font-size:1.2em;">touch foo</span></code></b>#* Create a new user named <b><code><span style="color:#3366CC;font-size:1.2em;">foobar</span></code></b>, with the option to automatically create a home directory.
#* Look at the contents of foobar's home directory. What do you notice?
# Be sure to record your observations in your lab notes.
{{Admon/note|Use centos1|Perform these steps in the '''centos1''' virtual machine.}}
# Read the man page for the <b><code><span style="color:#3366CC;font-size:1.2em;">groupadd and <b><code><span style="color:#3366CC;font-size:1.2em;">groupdel </span></code></b> commands.
# Note which option allows you to set the Group ID number (GID) when you create a new group.
# Examine the file <b><code><span style="color:#3366CC;font-size:1.2em;">/etc/group</span></code></b>
#* Which values of GID are reserved for system accounts?
#* Which values of GID are reserved for non-system user accounts?
#* What is the lowest available GID number for non-system users?
#* What is the default group name of a new user?
#* Add a new group named <b><code><span style="color:#3366CC;font-size:1.2em;">ops235 </span></code></b> with a GID of <b><code><span style="color:#3366CC;font-size:1.2em;">600</span></code></b>.
#* You are angry at some irresponsible users on your system.
#** Add a new group named idiots.
#** Look at /etc/group and note the GID of idiots.
#** What GID is given to a new group if if you do not specify it?
#** Your anger has subsided. Delete the <b><code><span style="color:#3366CC;font-size:1.2em;">idiots </span></code></b> group.
#** Look at /etc/group again and note the change.
{{Admon/note|Use centos1|Perform these steps in the '''centos1''' virtual machine.}}
# Read the man page for the <b><code><span style="color:#3366CC;font-size:1.2em;">userdel </span></code></b> command. Note which option automatically removes the users home directory when that user is deleted.
# Delete the user ops235_1 using the command <b><code><span style="color:#3366CC;font-size:1.2em;">userdel ops235_1</span></code></b>
# Delete the user ops235_2 using the same command with the option which removes the home directory of the user.
# Check the contents of the /home directory. What do you notice?
# Check the contents of the <b><code><span style="color:#3366CC;font-size:1.2em;">/etc/group </span></code></b> file. What do you notice?
Be sure to record your observations in your lab notes.
# Add each of your new users to the group ops235 (in other words, add ops235 to each user as a supplementary group).
# Examine <b><code><span style="color:#3366CC;font-size:1.2em;">/etc/group</span></code></b>. What has changed?# Use the usermod command to associate each of your pod mates' full name to their user name. With each change, examine their entries in the <b><code><span style="color:#3366CC;font-size:1.2em;">/etc/passwd</span></code></b> file. What has changed?
# Be sure to record your observations in your lab notes.
<li>Issue the following Linux command:
<ul>
<li><b><code><span style="color:#3366CC;font-size:1.2em;">runlevel</span></code></b></li>
</ul>
</li>
<li>Issue the following Linux command:
<ul>
<li><b><code><span style="color:#3366CC;font-size:1.2em;">startx</span></code></b></li>
</ul>
</li>
<li>Issue the following Linux command:
<ul>
<li><b><code><span style="color:#3366CC;font-size:1.2em;">service --status-all</span></code></b></li>
</ul>
</li>
<li>Note the services that are currently running.</li>
<li>Use the <b><code><span style="color:#3366CC;font-size:1.2em;">service</span></code></b> command to stop the service named '''iptables'''</li> <li>Issue the <b><code><span style="color:#3366CC;font-size:1.2em;">service</span></code></b> command to verify that this service has stopped.</li> <li>If you reboot now - the iptables service will be turned back on. We don't want it on though, it causes students headaches. To turn it off permanently we need to use the chkconfig command: <b><code><span style="color:#3366CC;font-size:1.2em;">chkconfig iptables off</span></code></b></li>
<li>Reboot and confirm that it's no longer running.</li>
</ol>