Skip Navigation

Milestone 4: User Account Setup

For this assignment, you will create a regular user to account to use instead of logging in as root. In addition, you will install a friendlier shell to use with this account, and set up doas to be able to run commands as root, and configure a Network Time Protocol (NTP) client to keep the clock set properly.

Page Contents

Milestone Worksheet

Please download the following worksheet Milestone 4. To be sure your browser downloads the file instead of trying to open it, right-click the following link and choose “Save As,” “Save Link As,” or similar language from the menu. (Each browser is a little different in what wording it uses.)

Background

Please read the following background lessons:

As you complete these readings, fill in the top part of the Milestone Worksheet. Note that you will need to return to these documents in order to get the commands needed for the steps in this milestone. This change in structure serves two purposes. First, it is designed to let you practice working with documentation, which is often topic-based instead of goal-based. Second, it avoids having one giant wall of text for this milestone.

Procedure

Step 1: Boot the Pi

If you’re using a wired network connection, be sure the cable is plugged in. Boot the Raspberry Pi either by plugging it into power (if unplugged) or pressing the power button (if plugged in). Log in as the root user, using the password you set in the previous milestone.

Wait a minute or two, and then check to be sure you have an Internet connection by running:

ip a s

You should see an IPv4 address next to an inet label on either your eth0 interface (if wired) or wlan0 interface (if using WiFi). If you don’t see an IPv4 address, or if you get network errors on the next step, return to the previous milestone to troubleshoot your network connection.

Step 1: Update the System

Update all the system packages first, since we’re going to be installing additional packages. The commands to update are:

apk update
apk upgrade

If you see the linux-tealpi package get upgraded, then you also need to reboot onto the new kernel (using the reboot command).

Step 2: Configure NTP

Configure the Network Time Protocol (NTP) client (chrony) using the instructions found in the Background section above.

Step 3: Install and Configure doas

Follow the instructions in the Background section above to install and configure the doas command.

Step 4: Switch to a Regular User Account

Follow the Creating a User Account instructions from the background section to create a regular user account for yourself. For your username, use your CCU username, which is the part of your CCU email address before the @ sign. For example, my email address is mmurphy2@coastal.edu, so my user name would be mmurphy2.

Be sure to add your new user account to all the legacy groups shown in the instructions document, since doing so makes things much easier later on in the semester.

Log out from the root account and switch to your regular user account.

Step 5: Switch to the Z Shell

Following the shell instructions from the background section, install and configure the Z Shell for your user account. Be sure to test that you have successfully switched to the Z Shell by logging out, then logging back in as your regular user.

You may further customize the Z Shell as explained in the instructions. The only requirements for this milestone are that your shell prompt must show:

  1. Your username,
  2. Your current working directory, and
  3. An indication as to whether or not the previously executed command was successful.

Step 6: Install Documentation

Although you can always go on the Internet to find documentation, it is often convenient to have local copies of manual pages and other documents.

Submission Guidelines

To prepare your submission photo for this assignment, run the following commands:

hostname
rc-service chronyd status
true
false

Check Your Work

Verify the following from the output of the commands you just ran:

  1. Your hostname is in the form username-csci311.coastal.edu, where username is the part of your CCU email address before the @ sign.
  2. Verify that the chronyd service has been started.
  3. Check that your username is in your shell prompt.
  4. Check that the current working directory is in your shell prompt.
  5. Check that your shell prompt distinguishes between a successful previous command (true) and an unsuccessful one (false).

Prepare Your Submission

Use your phone to take a photo of your screen, since you don’t yet have a screenshot tool available on the Pi. Transfer the photo to your computer, and replace the placeholder image in the Milestone Worksheet with your photo. Export the worksheet to PDF format, and upload the PDF to Moodle as the submission for the Milestone 4 assignment activity.

As a reminder, here are the instructions for editing the worksheet in either LibreOffice or Word Online:

Turn Off the Pi

When you’re finished working on the milestone, shut down the Raspberry Pi properly by running the following command:

poweroff

The Pi is shut down correctly when its status light changes from green to red. You may unplug the Pi after it has shut down, and it will start up again the next time you plug it in. Alternatively, you can leave the Pi plugged in. The status light (which should be red at this point) is also the power button on the official Pi case, so pressing it will turn on the Pi if power is connected.

ABET Assessment

Successful completion of this assignment satisfies the following performance indicator: