Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@ Explore servera's directory tree with `pwd`, `cd` and `ls`, using absolute and r
objectives=["ch03.hierarchy","ch03.paths"]
id="navigate"
title="Find your way around"
exercise="sa-navigate"
ownExercise=true
guided=true
starter=false
hosts=["workstation","servera"]
outcomes=["Move around with absolute and relative paths, ., .. and ~.","Read long listings and find hidden files.","Recognise a directory you may not enter."] %}

{% task id="task-9812fc5d33ae" title="Start the exercise" %}
On workstation, start the exercise. It removes any practice files from an earlier run from student's home on servera.

```console
[student@workstation ~]$ lab start sa-navigate
```

Later tasks assume that you are logged in to the server they name: `ssh student@servera` from workstation, then `sudo -i` for a root shell.
{% /task %}

{% task id="task-13825aae8cdb" title="Log in to servera and see where you start" %}

```console
Expand Down Expand Up @@ -106,4 +120,8 @@ total 0

The quotes keep `team notes.txt` as one name, and `ls` shows it quoted for the same reason, so you could copy it into a command as it is. The next lesson shows how to remove files. To put servera back as it was, run `rht-vmctl reset servera` on the Ubuntu host.
{% /task %}

{% task id="task-60a9e9b52693" title="Grade and finish" %}
{% lab-finish exercise="sa-navigate" grade=true servers=true /%}
{% /task %}
{% /lab %}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@ A colleague left a website's files in one heap. On servera, sort them into direc
objectives=["ch03.manage","ch03.paths"]
id="manage-files"
title="Organise a website's files"
exercise="sa-manage-files"
ownExercise=true
guided=true
starter=false
hosts=["workstation","servera"]
outcomes=["Create directories and empty files.","Move, rename and copy files and whole directories.","Remove files and directories, and see why rmdir is the safe choice."] %}

{% task id="task-d8e2a9960119" title="Start the exercise" %}
On workstation, start the exercise. It removes any site and archive directories from an earlier run from student's home on servera.

```console
[student@workstation ~]$ lab start sa-manage-files
```

Later tasks assume that you are logged in to the server they name: `ssh student@servera` from workstation, then `sudo -i` for a root shell.
{% /task %}

{% task id="task-5bf66e090adf" title="Create the site directory and its three subdirectories" %}

```console
Expand Down Expand Up @@ -142,4 +156,8 @@ rm: remove directory 'archive'? y

Leave `~/site` for now, or run `rht-vmctl reset servera` on the host to put servera back.
{% /task %}

{% task id="task-71399a5f96b8" title="Grade and finish" %}
{% lab-finish exercise="sa-manage-files" grade=true servers=true /%}
{% /task %}
{% /lab %}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@ Many applications keep each release in its own directory and point a link called
objectives=["ch03.links"]
id="links"
title="Switch releases with a link"
exercise="sa-links"
ownExercise=true
guided=true
starter=false
hosts=["workstation","servera"]
outcomes=["Create and repoint a symbolic link to a directory.","Keep a file's data alive with a hard link.","Recognise a dangling link."] %}

{% task id="task-e87e124c7f4e" title="Start the exercise" %}
On workstation, start the exercise. It removes any release directories and links from an earlier run from student's home on servera.

```console
[student@workstation ~]$ lab start sa-links
```

Later tasks assume that you are logged in to the server they name: `ssh student@servera` from workstation, then `sudo -i` for a root shell.
{% /task %}

{% task id="task-eaf78d3fd850" title="Create two releases" %}
On servera, as student, make two release directories, each with its own `app.conf`. `echo "text" > file` writes a line into a file (chapter 5 explains it):

Expand Down Expand Up @@ -111,11 +125,7 @@ version 2
`current` now dangles: it points to a name that is gone. The hard link kept the data, and its link count is back to 1.
{% /task %}

{% task id="task-4a9e86fa7e3c" title="Clean up" %}

```console
[student@servera ~]$ rm -r release current app.conf.saved
[student@servera ~]$ exit
```
{% task id="task-d7942db186ed" title="Grade and finish" %}
{% lab-finish exercise="sa-links" grade=true servers=true /%}
{% /task %}
{% /lab %}
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,6 @@ podcast_s2_e2.mp3 podcast_s2_e4.mp3 podcast_s2_e6.mp3
{% task id="task-c7f85590af3a" title="Grade and finish" %}
Log out of serverb, then on workstation:

{% lab-finish exercise="sa-files-review" grade=true /%}
{% lab-finish exercise="sa-files-review" grade=true servers=true /%}
{% /task %}
{% /lab %}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@ On servera, save command output to files, keep errors apart from results, discar
objectives=["ch05.redirect"]
id="redirection"
title="Capture and combine output"
exercise="sa-redirect"
ownExercise=true
guided=true
starter=false
hosts=["workstation","servera"]
outcomes=["Write and append output to files.","Separate errors from results, and discard them.","Build pipelines, and keep a copy with tee."] %}

{% task id="task-199503c05e6f" title="Start the exercise" %}
On workstation, start the exercise. It removes the result files of an earlier run from student's home on servera.

```console
[student@workstation ~]$ lab start sa-redirect
```

Later tasks assume that you are logged in to the server they name: `ssh student@servera` from workstation, then `sudo -i` for a root shell.
{% /task %}

{% task id="task-79966807d096" title="Save a list of configuration files" %}
On servera, as student, list the `.conf` files directly in `/etc` into `conf-files.txt`, then count and peek at it.

Expand Down Expand Up @@ -111,11 +125,7 @@ devtmpfs 455M 0 455M 0% /dev
{% /reveal %}
{% /task %}

{% task id="task-fec86414a779" title="Clean up" %}

```console
[student@servera ~]$ rm conf-files.txt found.txt errors.txt disk-report.txt
[student@servera ~]$ exit
```
{% task id="task-14c9a44075b1" title="Grade and finish" %}
{% lab-finish exercise="sa-redirect" grade=true servers=true /%}
{% /task %}
{% /lab %}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@ Work through the first lesson of vim's own tutorial, then use what it taught to
objectives=["ch05.vim"]
id="vim"
title="Create and edit a file with vim"
exercise="sa-vim"
ownExercise=true
guided=true
starter=false
hosts=["workstation","servera"]
outcomes=["Move between normal, insert and command-line mode.","Copy, paste, delete and undo lines, and replace text.","Save, or quit without saving."] %}

{% task id="task-e3f7ce51483c" title="Start the exercise" %}
On workstation, start the exercise. It removes welcome.txt of an earlier run from student's home on servera.

```console
[student@workstation ~]$ lab start sa-vim
```

Later tasks assume that you are logged in to the server they name: `ssh student@servera` from workstation, then `sudo -i` for a root shell.
{% /task %}

{% task id="task-727284164744" title="Do lesson 1 of vimtutor" %}
On servera, start the tutorial:

Expand Down Expand Up @@ -94,4 +108,8 @@ Contact: admin@lab.example.com
```
{% /reveal %}
{% /task %}

{% task id="task-062ea72bb36e" title="Grade and finish" %}
{% lab-finish exercise="sa-vim" grade=true servers=true /%}
{% /task %}
{% /lab %}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@ On servera, use variables and PATH to run your own command, create an alias, and
objectives=["ch05.environment","ch05.vim"]
id="environment"
title="Customise your shell"
exercise="sa-environment"
ownExercise=true
guided=true
starter=false
hosts=["workstation","servera"]
outcomes=["Use and export variables.","Run your own script through PATH.","Make an alias and environment settings permanent."] %}

{% task id="task-76e145a40cdd" title="Start the exercise" %}
On workstation, start the exercise. It restores student's start-up files on servera to the originals and removes ~/bin.

```console
[student@workstation ~]$ lab start sa-environment
```

Later tasks assume that you are logged in to the server they name: `ssh student@servera` from workstation, then `sudo -i` for a root shell.
{% /task %}

{% task id="task-8ef6dff987b9" title="See exporting at work" %}
On servera, set a variable, check that a child shell doesn't see it, export it, and check again.

Expand Down Expand Up @@ -110,4 +124,8 @@ vim
[student@servera ~]$ exit
```
{% /task %}

{% task id="task-33d39b3f4165" title="Grade and finish" %}
{% lab-finish exercise="sa-environment" grade=true servers=true /%}
{% /task %}
{% /lab %}
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,6 @@ vim
{% /task %}

{% task id="task-28043cd64cf1" title="Grade and finish" %}
{% lab-finish exercise="sa-text-review" grade=true /%}
{% lab-finish exercise="sa-text-review" grade=true servers=true /%}
{% /task %}
{% /lab %}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@ On servera, compare su and sudo, create a user who may not use sudo, then give t
objectives=["ch06.superuser"]
id="superuser"
title="Grant limited root access"
exercise="sa-sudo"
ownExercise=true
guided=true
starter=false
hosts=["workstation","servera"]
outcomes=["Switch to root with su - and sudo -i.","Write, check and test a narrow sudo rule.","Find sudo's record of allowed and refused commands."] %}

{% task id="task-fa89e230c528" title="Start the exercise" %}
On workstation, start the exercise. It removes a tester account and sudo rule left by an earlier run from servera.

```console
[student@workstation ~]$ lab start sa-sudo
```

Later tasks assume that you are logged in to the server they name: `ssh student@servera` from workstation, then `sudo -i` for a root shell.
{% /task %}

{% task id="task-9afd16d38260" title="Become root with su -, then with sudo -i" %}
On servera, as student. root's password in the lab is `redhat`; student's is `student`.

Expand Down Expand Up @@ -117,4 +131,8 @@ Sorry, user tester is not allowed to execute '/bin/systemctl restart sshd' as ro

Each line shows who, from which directory, as whom and what, and whether sudo allowed it.
{% /task %}

{% task id="task-049f8d2e2c27" title="Grade and finish" %}
{% lab-finish exercise="sa-sudo" grade=true servers=true /%}
{% /task %}
{% /lab %}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@ On servera, create a group for a web team, two people in it, and a service accou
objectives=["ch06.accounts","ch06.concepts"]
id="accounts"
title="Set up a web team"
exercise="sa-accounts"
ownExercise=true
guided=true
starter=false
hosts=["workstation","servera"]
outcomes=["Create a group with a chosen GID and users with supplementary groups.","Create a service account with nologin.","Recover from replacing a user's groups by mistake."] %}

{% task id="task-4067a94bdade" title="Start the exercise" %}
On workstation, start the exercise. It removes the accounts and the group of an earlier run from servera.

```console
[student@workstation ~]$ lab start sa-accounts
```

Later tasks assume that you are logged in to the server they name: `ssh student@servera` from workstation, then `sudo -i` for a root shell.
{% /task %}

{% task id="task-e9566e8670be" title="Create the group" %}
On servera, open a root shell with `sudo -i`, and create the group `webteam` with GID 40000.

Expand Down Expand Up @@ -95,14 +109,7 @@ drwx------. 2 webapp webteam 4096 Oct 3 10:36 /home/webapp
Mode `700` (`drwx------`): each owner, and nobody else, may enter their home. `/home/webapp` belongs to the group `webteam` because that is webapp's primary group.
{% /task %}

{% task id="task-4d710a1ff0e6" title="Clean up" %}
Delete the three accounts with their home directories, then the group. If `userdel` reports that a user *is currently used by process* N, a process still runs as that account (for example from an earlier `su`): wait a moment and try again, or reset servera.

```console
[root@servera ~]# userdel -r alice; userdel -r bob; userdel -r webapp
[root@servera ~]# groupdel webteam
[root@servera ~]# exit
[student@servera ~]$ exit
```
{% task id="task-16d7cf000ea3" title="Grade and finish" %}
{% lab-finish exercise="sa-accounts" grade=true servers=true /%}
{% /task %}
{% /lab %}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@ An intern starts on servera today. Give them a temporary password they must chan
objectives=["ch06.passwords"]
id="passwords"
title="Onboard and offboard an intern"
exercise="sa-passwords"
ownExercise=true
guided=true
starter=false
hosts=["workstation","servera"]
outcomes=["Set a temporary password and force a change at the next login.","Apply password ageing with chage.","See the difference between locking and expiring an account."] %}

{% task id="task-05f7cae6c3c5" title="Start the exercise" %}
On workstation, start the exercise. It removes an intern account left by an earlier run from servera.

```console
[student@workstation ~]$ lab start sa-passwords
```

Later tasks assume that you are logged in to the server they name: `ssh student@servera` from workstation, then `sudo -i` for a root shell.
{% /task %}

{% task id="task-f7644ce3f4a5" title="Create the account with a temporary password" %}
On servera as root (`sudo -i`), create `intern` ("Summer intern"), set the password `Welcome-2026`, and force a change at the next login.

Expand Down Expand Up @@ -100,11 +114,7 @@ su: User account has expired
Unlike a lock, expiry blocks every kind of login, including SSH keys. The account and its files remain, for the handover.
{% /task %}

{% task id="task-8faa4ecab9f2" title="Clean up" %}

```console
[student@servera ~]$ sudo userdel -r intern
[student@servera ~]$ exit
```
{% task id="task-a28b7e5c2b0f" title="Grade and finish" %}
{% lab-finish exercise="sa-passwords" grade=true servers=true /%}
{% /task %}
{% /lab %}
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@ backup:x:3200:35000::/home/backup:/sbin/nologin
{% task id="task-08e46a024567" title="Grade and finish" %}
Leave serverb, then on workstation:

{% lab-finish exercise="sa-users-review" grade=true /%}
{% lab-finish exercise="sa-users-review" grade=true servers=true /%}
{% /task %}
{% /lab %}
Loading