Beginner Capstone: Personal Linux Workspace
On this page
Your Linux lab needs a workspace you can maintain and hand over: notes you understand, a small log investigation, and an archive another machine can verify. Build it, recover from two deliberate mistakes, and collect evidence that the result works. Documentation and earlier lessons are allowed throughout.
Hand in a directory listing, selected command transcripts with your explanations, verified archive contents, and a successful transfer check. Keep the evidence outside the exercise directories before resetting them.
You pass when the required files and permissions are correct, you can explain the commands you chose, and you recover from both a missing path and an intentional permission error. The archive must restore without differences and arrive unchanged on the lab server. Cleanup must be verified on both machines.
The workstation opens the terminal or console where you operate the LOCAL Linux machine, rootvolt. It also provides independent console access to the REMOTE lab server, labserver. SSH carries your remote shell session; SFTP carries the archive between the Linux machines.
Before you start
Section titled “Before you start”Finish the archives practice and its reset. Use your Ubuntu lab VM and ~/lab from the practice directory setup. Reserve ~/lab/capstone locally and ~/capstone.tar.gz on the lab server; neither may already exist. Choose different exercise names if those paths contain your own work.
The lab server can be a second machine you control with an SSH server and console access. Use its actual hostname and your account in place of labserver and learner. Complete the SSH preparation before connecting.
Dates, compressed sizes, archive digests, package versions, mirror lines, download sizes, addresses, host fingerprints, and transfer speeds will differ. Compare values from your own run. The recorded login banner names the container’s WSL2 kernel; your banner names your own system and kernel.
Try each goal before opening its evidence check. Each collapsed recording is one possible way; other correct commands pass too. The recordings are real lab-container runs. They cannot demonstrate building a VM or operating full-screen editors. Separate recordings start clean, with the preceding workspace state prepared where needed; you continue with your own files.
1. Build and identify your lab machine
Section titled “1. Build and identify your lab machine”Goal: Build a working Ubuntu VM with a regular user account and terminal access. Follow Create and install a VM and Network and snapshots.
Evidence: Keep your VM configuration and a successful console login, plus terminal evidence of your username, hostname, and distribution release. Explain which machine runs the shell.
You pass this stage when you can reopen the VM and identify the Linux account, host, and release. The following recording checks identity only; it is not evidence of a VM installation.
Check your evidence: one possible identity check
learner@rootvolt:~/lab$ whoamilearnerlearner@rootvolt:~/lab$ hostnamerootvoltlearner@rootvolt:~/lab$ grep '^PRETTY_NAME=' /etc/os-releasePRETTY_NAME="Ubuntu 24.04.5 LTS"learner@rootvolt:~/lab$ Steps (9)
- Type
whoami - Press Enter — Identify the unprivileged account
- Output:
learner - Type
hostname - Press Enter — Identify the local Linux host
- Output:
rootvolt - Type
grep '^PRETTY_NAME=' /etc/os-release - Press Enter — Read the distribution release without claiming a VM build
- Output:
PRETTY_NAME="Ubuntu 24.04.5 LTS"
The captured release is Ubuntu 24.04.5 LTS. Your VM’s point release may differ.
2. Create a structured workspace and recover a missing path
Section titled “2. Create a structured workspace and recover a missing path”Goal: Before creating ~/lab/capstone, try to enter it. Read the failure, confirm where you still are, then create the workspace. Under bundle, separate notes, logs, and results directories.
Evidence: Save the failed navigation, your location immediately afterward, and a directory listing after recovery. Explain which path the shell could not find and why the failed cd changed neither your working directory nor your files.
You pass this stage when the missing-path error is explained and all three directories exist under the intended workspace.
Hint: Absolute and relative paths.
Check your evidence: one possible workspace run
learner@rootvolt:~/lab$ cd ~/lab/capstone/bash: cd: /home/learner/lab/capstone/: No such file or directorylearner@rootvolt:~/lab$ pwd/home/learner/lablearner@rootvolt:~/lab$ mkdir -p ~/lab/capstonelearner@rootvolt:~/lab$ cd ~/lab/capstonelearner@rootvolt:~/lab/capstone$ mkdir -p bundle/notes bundle/logs bundle/resultslearner@rootvolt:~/lab/capstone$ find bundle -type dbundle
bundle/results
bundle/notes
bundle/logslearner@rootvolt:~/lab/capstone$ Steps (15)
- Type
cd ~/lab/capstone/ - Press Enter — Notice the missing path before creating anything
- Output:
bash: cd: /home/learner/lab/capstone/: No such file or directory - Type
pwd - Press Enter — Confirm the failed cd kept the working directory
- Output:
/home/learner/lab - Type
mkdir -p ~/lab/capstone - Press Enter — Create the missing workspace directory
- Type
cd ~/lab/capstone - Press Enter — Enter the directory after creating it
- Type
mkdir -p bundle/notes bundle/logs bundle/results - Press Enter — Create separate directories for notes, logs, and results
- Type
find bundle -type d - Press Enter — Collect the initial directory structure
- Output:
bundle bundle/results bundle/notes bundle/logs
3. Write two notes with Nano and Vim
Section titled “3. Write two notes with Nano and Vim”Goal: In Nano, create bundle/notes/nano.txt with these exact contents and a final newline:
Personal Linux workspaceKeep notes, logs, and results separate.In Vim, create bundle/notes/vim.txt with these exact contents and a final newline:
Command explanationsmkdir -p creates missing parent directories.grep selects matching lines; > saves them in a file.chmod u+r restores read permission for the owner.Evidence: Read both saved files from the shell. Keep checksums or another content check, and add explanations of your own chosen commands to your hand-in. Include an option, a pathname argument, and a redirection. Record that you saved and exited each editor.
You pass this stage when both editors have been used, both saved notes match, and your explanations describe what the commands do to your files.
Check your evidence: one possible saved-file check
The recording uses printf to prepare the exact note contents because full-screen editors are not captured as text. Write the files with Nano and Vim yourself. The recording proves the resulting file contents, not editor use.
learner@rootvolt:~/lab/capstone$ cd bundle/noteslearner@rootvolt:~/lab/capstone/bundle/notes$ printf '%s\n' 'Personal Linux workspace' > nano.txtlearner@rootvolt:~/lab/capstone/bundle/notes$ printf '%s\n' 'Keep notes, logs, and results separate.' >> nano.txtlearner@rootvolt:~/lab/capstone/bundle/notes$ printf '%s\n' 'Command explanations' > vim.txtlearner@rootvolt:~/lab/capstone/bundle/notes$ printf '%s\n' 'mkdir -p creates missing parent directories.' >> vim.txtlearner@rootvolt:~/lab/capstone/bundle/notes$ printf '%s\n' 'grep selects matching lines; > saves them in a file.' >> vim.txtlearner@rootvolt:~/lab/capstone/bundle/notes$ printf '%s\n' 'chmod u+r restores read permission for the owner.' >> vim.txtlearner@rootvolt:~/lab/capstone/bundle/notes$ cd ../..learner@rootvolt:~/lab/capstone$ cat bundle/notes/nano.txtPersonal Linux workspace
Keep notes, logs, and results separate.learner@rootvolt:~/lab/capstone$ cat bundle/notes/vim.txtCommand explanations
mkdir -p creates missing parent directories.
grep selects matching lines; > saves them in a file.
chmod u+r restores read permission for the owner.learner@rootvolt:~/lab/capstone$ sha256sum bundle/notes/*.txt0d2b66a971651927aadcc636019d2ee5f934c8b8f472bbc62fb40ef12b6a35c2 bundle/notes/nano.txt
df6b46815dd3aa90d3c3569663556622364afec564f623f53561ca977298ff48 bundle/notes/vim.txtlearner@rootvolt:~/lab/capstone$ Steps (25)
- Type
cd bundle/notes - Press Enter — Enter the notes directory before preparing both editor files
- Type
printf '%s\n' 'Personal Linux workspace' > nano.txt - Press Enter — Write the Nano note heading
- Type
printf '%s\n' 'Keep notes, logs, and results separate.' >> nano.txt - Press Enter — Append the workspace organization note
- Type
printf '%s\n' 'Command explanations' > vim.txt - Press Enter — Write the explanation heading
- Type
printf '%s\n' 'mkdir -p creates missing parent directories.' >> vim.txt - Press Enter — Append the directory-creation explanation
- Type
printf '%s\n' 'grep selects matching lines; > saves them in a file.' >> vim.txt - Press Enter — Append the filtering and redirection explanation
- Type
printf '%s\n' 'chmod u+r restores read permission for the owner.' >> vim.txt - Press Enter — Append the permission-repair explanation
- Type
cd ../.. - Press Enter — Return to the workspace before checking both notes
- Type
cat bundle/notes/nano.txt - Press Enter — Read the saved Nano note
- Output:
Personal Linux workspace Keep notes, logs, and results separate. - Type
cat bundle/notes/vim.txt - Press Enter — Read the saved Vim note
- Output:
Command explanations mkdir -p creates missing parent directories. grep selects matching lines; > saves them in a file. chmod u+r restores read permission for the owner. - Type
sha256sum bundle/notes/*.txt - Press Enter — Collect content checks for both notes
- Output:
0d2b66a971651927aadcc636019d2ee5f934c8b8f472bbc62fb40ef12b6a35c2 bundle/notes/nano.txt df6b46815dd3aa90d3c3569663556622364afec564f623f53561ca977298ff48 bundle/notes/vim.txt
| Note | Captured SHA-256 digest |
|---|---|
nano.txt |
0d2b66a971651927aadcc636019d2ee5f934c8b8f472bbc62fb40ef12b6a35c2 |
vim.txt |
df6b46815dd3aa90d3c3569663556622364afec564f623f53561ca977298ff48 |
4. Inspect permissions and recover a denied read
Section titled “4. Inspect permissions and recover a denied read”Goal: Keep the workspace and its directories private to your account: owner read, write, and search permissions only. Notes must have owner read and write permissions only. Deliberately remove owner read permission from nano.txt, attempt to read it as your regular user, inspect its mode, restore the permission, and read it again.
Evidence: Keep the denied read, the mode while broken, the repair, and the successful read. Explain that the pathname exists but the owner lacks read access. Identify the missing r in the owner’s three mode positions.
You pass this stage when the denied read is explained and repaired without using root, directories have mode 700, and notes have mode 600.
Hint: Changing ownership and permissions.
Check your evidence: one possible permission recovery
learner@rootvolt:~/lab/capstone$ chmod 700 . bundle bundle/notes bundle/logs bundle/resultslearner@rootvolt:~/lab/capstone$ chmod 600 bundle/notes/*.txtlearner@rootvolt:~/lab/capstone$ chmod u-r bundle/notes/nano.txtlearner@rootvolt:~/lab/capstone$ cat -- bundle/notes/nano.txtcat: bundle/notes/nano.txt: Permission deniedlearner@rootvolt:~/lab/capstone$ ls -l bundle/notes/nano.txt--w------- 1 learner learner 65 Nov 15 19:34 bundle/notes/nano.txtlearner@rootvolt:~/lab/capstone$ chmod u+r bundle/notes/nano.txtlearner@rootvolt:~/lab/capstone$ cat ./bundle/notes/nano.txtPersonal Linux workspace
Keep notes, logs, and results separate.learner@rootvolt:~/lab/capstone$ ls -l bundle/notestotal 8
-rw------- 1 learner learner 65 Nov 15 19:34 nano.txt
-rw------- 1 learner learner 169 Nov 15 19:34 vim.txtlearner@rootvolt:~/lab/capstone$ Steps (20)
- Type
chmod 700 . bundle bundle/notes bundle/logs bundle/results - Press Enter — Restrict workspace directories to the owner
- Type
chmod 600 bundle/notes/*.txt - Press Enter — Keep the two notes private
- Type
chmod u-r bundle/notes/nano.txt - Press Enter — Intentionally remove owner read permission
- Type
cat -- bundle/notes/nano.txt - Press Enter — Observe the denied read as the file owner
- Output:
cat: bundle/notes/nano.txt: Permission denied - Type
ls -l bundle/notes/nano.txt - Press Enter — Inspect the missing owner read bit
- Output:
--w------- 1 learner learner 65 Nov 15 19:34 bundle/notes/nano.txt - Type
chmod u+r bundle/notes/nano.txt - Press Enter — Restore only the missing read permission
- Type
cat ./bundle/notes/nano.txt - Press Enter — Verify that reading works again
- Output:
Personal Linux workspace Keep notes, logs, and results separate. - Type
ls -l bundle/notes - Press Enter — Collect the restored note permissions
- Output:
total 8 -rw------- 1 learner learner 65 Nov 15 19:34 nano.txt -rw------- 1 learner learner 169 Nov 15 19:34 vim.txt
The error names bundle/notes/nano.txt and says Permission denied: the file exists, unlike the missing path in stage 2. ls -l shows that its owner is learner, the account running cat, so the first permission triplet applies. In --w-------, that triplet is -w-: it lacks r. After the repair, the notes show -rw-------.
5. Filter synthetic logs into a saved result
Section titled “5. Filter synthetic logs into a saved result”Goal: Create bundle/logs/activity.log with this synthetic input and a final newline. Do not copy a system log.
INFO workspace openedWARN backup overdueINFO notes savedWARN review permissionsLocate the log by filename, find its warning line numbers, and save only the warning text to bundle/results/warnings.txt. Preserve the original. Make both files private, with owner read and write permissions only.
Evidence: Keep the located pathname, matching source line numbers, saved result, and directory permissions.
You pass this stage when the source still has four lines and the result contains exactly its two WARN lines without added line numbers. The files have mode 600; the directories retain mode 700.
Hints: Searching inside files and Redirection.
Check your evidence: one possible filtering run
learner@rootvolt:~/lab/capstone$ printf '%s\n' 'INFO workspace opened' > bundle/logs/activity.loglearner@rootvolt:~/lab/capstone$ printf '%s\n' 'WARN backup overdue' >> bundle/logs/activity.loglearner@rootvolt:~/lab/capstone$ printf '%s\n' 'INFO notes saved' >> bundle/logs/activity.loglearner@rootvolt:~/lab/capstone$ printf '%s\n' 'WARN review permissions' >> bundle/logs/activity.loglearner@rootvolt:~/lab/capstone$ find bundle -name '*.log'bundle/logs/activity.loglearner@rootvolt:~/lab/capstone$ grep -n '^WARN ' bundle/logs/activity.log2:WARN backup overdue
4:WARN review permissionslearner@rootvolt:~/lab/capstone$ grep '^WARN ' bundle/logs/activity.log > bundle/results/warnings.txtlearner@rootvolt:~/lab/capstone$ chmod 600 bundle/logs/activity.log bundle/results/warnings.txtlearner@rootvolt:~/lab/capstone$ cat bundle/results/warnings.txtWARN backup overdue
WARN review permissionslearner@rootvolt:~/lab/capstone$ ls -ld bundle bundle/*drwx------ 5 learner learner 4096 Nov 15 19:34 bundle
drwx------ 2 learner learner 4096 Nov 15 19:34 bundle/logs
drwx------ 2 learner learner 4096 Nov 15 19:34 bundle/notes
drwx------ 2 learner learner 4096 Nov 15 19:34 bundle/resultslearner@rootvolt:~/lab/capstone$ Steps (24)
- Type
printf '%s\n' 'INFO workspace opened' > bundle/logs/activity.log - Press Enter — Start the synthetic log with the opening event
- Type
printf '%s\n' 'WARN backup overdue' >> bundle/logs/activity.log - Press Enter — Append the backup warning
- Type
printf '%s\n' 'INFO notes saved' >> bundle/logs/activity.log - Press Enter — Append the saved-notes event
- Type
printf '%s\n' 'WARN review permissions' >> bundle/logs/activity.log - Press Enter — Append the permission-review warning
- Type
find bundle -name '*.log' - Press Enter — Locate the synthetic source by name
- Output:
bundle/logs/activity.log - Type
grep -n '^WARN ' bundle/logs/activity.log - Press Enter — Identify the two source line numbers
- Output:
2:WARN backup overdue 4:WARN review permissions - Type
grep '^WARN ' bundle/logs/activity.log > bundle/results/warnings.txt - Press Enter — Save only warning text
- Type
chmod 600 bundle/logs/activity.log bundle/results/warnings.txt - Press Enter — Make input and saved result private
- Type
cat bundle/results/warnings.txt - Press Enter — Check the exact saved warning lines
- Output:
WARN backup overdue WARN review permissions - Type
ls -ld bundle bundle/* - Press Enter — Collect directory modes
- Output:
drwx------ 5 learner learner 4096 Nov 15 19:34 bundle drwx------ 2 learner learner 4096 Nov 15 19:34 bundle/logs drwx------ 2 learner learner 4096 Nov 15 19:34 bundle/notes drwx------ 2 learner learner 4096 Nov 15 19:34 bundle/results
6. Install a utility and collect the directory listing
Section titled “6. Install a utility and collect the directory listing”Goal: Inspect the repository’s tree package, refresh package indexes, and install it on your Ubuntu lab machine. Use it to collect the completed bundle’s directory listing. Review the proposed package changes before accepting them.
Evidence: Keep the package metadata, successful installation, and listing. Remove tree after collecting the listing, and verify that it is no longer installed. This exercise assumes it was absent before you began; retain software that was already yours.
You pass this stage when the listing contains notes/nano.txt, notes/vim.txt, logs/activity.log, and results/warnings.txt, and the package installed for the exercise has been removed.
Hint: APT everyday operations.
Check your evidence: one possible utility lifecycle
learner@rootvolt:~/lab$ sudo -v[sudo] password for learner: learner@rootvolt:~/lab$ sudo apt updateGet:1 http://archive.ubuntu.com/ubuntu noble InRelease [256 kB]
Get:2 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]
Get:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]
Get:4 http://security.ubuntu.com/ubuntu noble-security/multiverse amd64 Packages [55.6 kB]
Get:5 http://archive.ubuntu.com/ubuntu noble-backports InRelease [126 kB]
Get:6 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 Packages [2,211 kB]
Get:7 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages [19.3 MB]
Get:8 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages [1,471 kB]
Get:9 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Packages [1,557 kB]
Get:10 http://archive.ubuntu.com/ubuntu noble/restricted amd64 Packages [117 kB]
Get:11 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages [1,808 kB]
Get:12 http://archive.ubuntu.com/ubuntu noble/multiverse amd64 Packages [331 kB]
Get:13 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [1,792 kB]
Get:14 http://archive.ubuntu.com/ubuntu noble-updates/restricted amd64 Packages [2,324 kB]
Get:15 http://archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 Packages [61.7 kB]
Get:16 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [2,179 kB]
Get:17 http://archive.ubuntu.com/ubuntu noble-backports/universe amd64 Packages [36.0 kB]
Get:18 http://archive.ubuntu.com/ubuntu noble-backports/main amd64 Packages [49.0 kB]
Get:19 http://archive.ubuntu.com/ubuntu noble-backports/multiverse amd64 Packages [669 B]
Fetched 33.9 MB in 5s (7,537 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
5 packages can be upgraded. Run 'apt list --upgradable' to see them.learner@rootvolt:~/lab$ apt show treePackage: tree
Version: 2.1.1-2ubuntu3.24.04.2
Priority: optional
Section: universe/utils
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Florian Ernst <florian@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 111 kB
Depends: libc6 (>= 2.38)
Homepage: http://oldmanprogrammer.net/source.php?dir=projects/tree
Task: xubuntu-desktop, lubuntu-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop-minimal, ubuntu-budgie-desktop, ubuntu-budgie-desktop-raspi, ubuntu-unity-desktop, ubuntucinnamon-desktop-minimal, ubuntucinnamon-desktop-raspi
Download-Size: 47.4 kB
APT-Sources: http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages
Description: displays an indented directory tree, in color
N: There is 1 additional record. Please use the '-a' switch to see itlearner@rootvolt:~/lab$ sudo apt install --simulate treeReading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
tree
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Inst tree (2.1.1-2ubuntu3.24.04.2 Ubuntu:24.04/noble-updates [amd64])
Conf tree (2.1.1-2ubuntu3.24.04.2 Ubuntu:24.04/noble-updates [amd64])learner@rootvolt:~/lab$ sudo apt install --yes -o Dpkg::Progress-Fancy=0 treeReading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
tree
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 47.4 kB of archives.
After this operation, 111 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 tree amd64 2.1.1-2ubuntu3.24.04.2 [47.4 kB]
Fetched 47.4 kB in 0s (101 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package tree.
(Reading database ... 11321 files and directories currently installed.)
Preparing to unpack .../tree_2.1.1-2ubuntu3.24.04.2_amd64.deb ...
Unpacking tree (2.1.1-2ubuntu3.24.04.2) ...
Setting up tree (2.1.1-2ubuntu3.24.04.2) ...
Processing triggers for man-db (2.12.0-4build2) ...learner@rootvolt:~/lab$ tree ~/lab/capstone/bundle/home/learner/lab/capstone/bundle
├── logs
│ └── activity.log
├── notes
│ ├── nano.txt
│ └── vim.txt
└── results
└── warnings.txt
4 directories, 4 fileslearner@rootvolt:~/lab$ sudo apt remove --yes -o Dpkg::Progress-Fancy=0 treeReading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
tree
0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded.
After this operation, 111 kB disk space will be freed.
(Reading database ... 11328 files and directories currently installed.)
Removing tree (2.1.1-2ubuntu3.24.04.2) ...
Processing triggers for man-db (2.12.0-4build2) ...learner@rootvolt:~/lab$ dpkg-query -W -f='${Package}: ${Status}\n' treedpkg-query: no packages found matching treelearner@rootvolt:~/lab$ cd ~/lab/capstonelearner@rootvolt:~/lab/capstone$ rm bundle/notes/nano.txt bundle/notes/vim.txtlearner@rootvolt:~/lab/capstone$ rm bundle/logs/activity.log bundle/results/warnings.txtlearner@rootvolt:~/lab/capstone$ rmdir bundle/notes bundle/logs bundle/results bundlelearner@rootvolt:~/lab/capstone$ cd ~/lablearner@rootvolt:~/lab$ rmdir capstonelearner@rootvolt:~/lab$ test ! -e capstone && printf 'Workspace absent\n'Workspace absentlearner@rootvolt:~/lab$ Steps (41)
- Type
sudo -v - Press Enter — Authenticate for package administration
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter — Submit the hidden lab password
- Type
sudo apt update - Press Enter — Refresh repository indexes
- Output:
Get:1 http://archive.ubuntu.com/ubuntu noble InRelease [256 kB] Get:2 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB] Get:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB] Get:4 http://security.ubuntu.com/ubuntu noble-security/multiverse amd64 Packages [55.6 kB] Get:5 http://archive.ubuntu.com/ubuntu noble-backports InRelease [126 kB] Get:6 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 Packages [2,211 kB] Get:7 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages [19.3 MB] Get:8 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages [1,471 kB] Get:9 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Packages [1,557 kB] Get:10 http://archive.ubuntu.com/ubuntu noble/restricted amd64 Packages [117 kB] Get:11 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages [1,808 kB] Get:12 http://archive.ubuntu.com/ubuntu noble/multiverse amd64 Packages [331 kB] Get:13 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [1,792 kB] Get:14 http://archive.ubuntu.com/ubuntu noble-updates/restricted amd64 Packages [2,324 kB] Get:15 http://archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 Packages [61.7 kB] Get:16 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [2,179 kB] Get:17 http://archive.ubuntu.com/ubuntu noble-backports/universe amd64 Packages [36.0 kB] Get:18 http://archive.ubuntu.com/ubuntu noble-backports/main amd64 Packages [49.0 kB] Get:19 http://archive.ubuntu.com/ubuntu noble-backports/multiverse amd64 Packages [669 B] Fetched 33.9 MB in 5s (7,537 kB/s) Reading package lists... Done Building dependency tree... Done Reading state information... Done 5 packages can be upgraded. Run 'apt list --upgradable' to see them. - Type
apt show tree - Press Enter — Inspect the utility before installation
- Output:
Package: tree Version: 2.1.1-2ubuntu3.24.04.2 Priority: optional Section: universe/utils Origin: Ubuntu Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Original-Maintainer: Florian Ernst <florian@debian.org> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 111 kB Depends: libc6 (>= 2.38) Homepage: http://oldmanprogrammer.net/source.php?dir=projects/tree Task: xubuntu-desktop, lubuntu-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop-minimal, ubuntu-budgie-desktop, ubuntu-budgie-desktop-raspi, ubuntu-unity-desktop, ubuntucinnamon-desktop-minimal, ubuntucinnamon-desktop-raspi Download-Size: 47.4 kB APT-Sources: http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages Description: displays an indented directory tree, in color N: There is 1 additional record. Please use the '-a' switch to see it - Type
sudo apt install --simulate tree - Press Enter — Preview the package plan without changing installed packages
- Output:
Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: tree 0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded. Inst tree (2.1.1-2ubuntu3.24.04.2 Ubuntu:24.04/noble-updates [amd64]) Conf tree (2.1.1-2ubuntu3.24.04.2 Ubuntu:24.04/noble-updates [amd64]) - Type
sudo apt install --yes -o Dpkg::Progress-Fancy=0 tree - Press Enter — Install the reviewed directory listing utility
- Output:
Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: tree 0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded. Need to get 47.4 kB of archives. After this operation, 111 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 tree amd64 2.1.1-2ubuntu3.24.04.2 [47.4 kB] Fetched 47.4 kB in 0s (101 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package tree. (Reading database ... 11321 files and directories currently installed.) Preparing to unpack .../tree_2.1.1-2ubuntu3.24.04.2_amd64.deb ... Unpacking tree (2.1.1-2ubuntu3.24.04.2) ... Setting up tree (2.1.1-2ubuntu3.24.04.2) ... Processing triggers for man-db (2.12.0-4build2) ... - Type
tree ~/lab/capstone/bundle - Press Enter — Collect the complete project directory listing
- Output:
/home/learner/lab/capstone/bundle ├── logs │ └── activity.log ├── notes │ ├── nano.txt │ └── vim.txt └── results └── warnings.txt 4 directories, 4 files - Type
sudo apt remove --yes -o Dpkg::Progress-Fancy=0 tree - Press Enter — Remove the utility installed for this project
- Output:
Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages will be REMOVED: tree 0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded. After this operation, 111 kB disk space will be freed. (Reading database ... 11328 files and directories currently installed.) Removing tree (2.1.1-2ubuntu3.24.04.2) ... Processing triggers for man-db (2.12.0-4build2) ... - Type
dpkg-query -W -f='${Package}: ${Status}\n' tree - Press Enter — Verify tree is no longer installed
- Output:
dpkg-query: no packages found matching tree - Type
cd ~/lab/capstone - Press Enter — Enter the prepared workspace for cleanup
- Type
rm bundle/notes/nano.txt bundle/notes/vim.txt - Press Enter — Remove the two known editor notes
- Type
rm bundle/logs/activity.log bundle/results/warnings.txt - Press Enter — Remove the synthetic log and saved warning result
- Type
rmdir bundle/notes bundle/logs bundle/results bundle - Press Enter — Remove empty prepared directories
- Type
cd ~/lab - Press Enter — Return to the baseline lab
- Type
rmdir capstone - Press Enter — Remove the fixture workspace
- Type
test ! -e capstone && printf 'Workspace absent\n' - Press Enter — Verify the workspace reset
- Output:
Workspace absent
The -o Dpkg::Progress-Fancy=0 option only keeps the recorded output plain text and can be omitted in a normal terminal; see the APT lesson.
APT installs a package without asking when nothing else is added, so the review uses --simulate: it prints the plan and changes nothing. The run then installs one package and removes one package. The final package query reports no matching package and exits with status 1, confirming absence. Your repository version and download amounts can differ. The workspace cleanup at the end belongs to this separate recording; keep your own workspace for the archive stage.
7. Archive the workspace and test recovery
Section titled “7. Archive the workspace and test recovery”Goal: Create bundle.tar.gz containing bundle, inspect every member name, and extract into an empty restored directory. Compare the restored bundle with the original. Record the local archive’s complete SHA-256 digest.
Evidence: Keep the member list, independent extraction, recursive comparison, its exit status, and local digest. Inspect restored permissions too.
You pass this stage when the archive contains the four intended files under bundle/, recovery preserves their text, and the comparison returns status 0. The recovered directories and files retain the intended private modes.
Hint: Creating and inspecting archives.
Check your evidence: one possible archive test
learner@rootvolt:~/lab/capstone$ tar -czf bundle.tar.gz bundlelearner@rootvolt:~/lab/capstone$ tar -tf bundle.tar.gzbundle/
bundle/results/
bundle/results/warnings.txt
bundle/notes/
bundle/notes/vim.txt
bundle/notes/nano.txt
bundle/logs/
bundle/logs/activity.loglearner@rootvolt:~/lab/capstone$ sha256sum bundle.tar.gzcfcaa01933a26a70548ae039f17a96375ace2c9fda6b164795356c078badb676 bundle.tar.gzlearner@rootvolt:~/lab/capstone$ mkdir restoredlearner@rootvolt:~/lab/capstone$ tar -xf bundle.tar.gz -C restoredlearner@rootvolt:~/lab/capstone$ diff -r bundle restored/bundlelearner@rootvolt:~/lab/capstone$ echo $?0learner@rootvolt:~/lab/capstone$ ls -ld restored/bundle restored/bundle/*drwx------ 5 learner learner 4096 Nov 15 19:34 restored/bundle
drwx------ 2 learner learner 4096 Nov 15 19:34 restored/bundle/logs
drwx------ 2 learner learner 4096 Nov 15 19:34 restored/bundle/notes
drwx------ 2 learner learner 4096 Nov 15 19:34 restored/bundle/resultslearner@rootvolt:~/lab/capstone$ ls -l restored/bundle/*restored/bundle/logs:
total 4
-rw------- 1 learner learner 83 Nov 15 19:34 activity.log
restored/bundle/notes:
total 8
-rw------- 1 learner learner 65 Nov 15 19:34 nano.txt
-rw------- 1 learner learner 169 Nov 15 19:34 vim.txt
restored/bundle/results:
total 4
-rw------- 1 learner learner 44 Nov 15 19:34 warnings.txtlearner@rootvolt:~/lab/capstone$ Steps (23)
- Type
tar -czf bundle.tar.gz bundle - Press Enter — Package the source and saved result together
- Type
tar -tf bundle.tar.gz - Press Enter — Inspect the archive members before transferring
- Output:
bundle/ bundle/results/ bundle/results/warnings.txt bundle/notes/ bundle/notes/vim.txt bundle/notes/nano.txt bundle/logs/ bundle/logs/activity.log - Type
sha256sum bundle.tar.gz - Press Enter — Record the local digest for remote comparison
- Output:
cfcaa01933a26a70548ae039f17a96375ace2c9fda6b164795356c078badb676 bundle.tar.gz - Type
mkdir restored - Press Enter — Create a clean destination to test the practice archive
- Type
tar -xf bundle.tar.gz -C restored - Press Enter — Restore a copy while preserving the original bundle
- Type
diff -r bundle restored/bundle - Press Enter — Compare the original and restored directory trees
- Type
echo $? - Press Enter — Check the successful recursive comparison status
- Output:
0 - Type
ls -ld restored/bundle restored/bundle/* - Press Enter — Inspect the restored bundle and its three directory modes
- Output:
drwx------ 5 learner learner 4096 Nov 15 19:34 restored/bundle drwx------ 2 learner learner 4096 Nov 15 19:34 restored/bundle/logs drwx------ 2 learner learner 4096 Nov 15 19:34 restored/bundle/notes drwx------ 2 learner learner 4096 Nov 15 19:34 restored/bundle/results - Type
ls -l restored/bundle/* - Press Enter — Inspect the recovered files in each bundle directory
- Output:
restored/bundle/logs: total 4 -rw------- 1 learner learner 83 Nov 15 19:34 activity.log restored/bundle/notes: total 8 -rw------- 1 learner learner 65 Nov 15 19:34 nano.txt -rw------- 1 learner learner 169 Nov 15 19:34 vim.txt restored/bundle/results: total 4 -rw------- 1 learner learner 44 Nov 15 19:34 warnings.txt
The file members are bundle/notes/nano.txt, bundle/notes/vim.txt, bundle/logs/activity.log, and bundle/results/warnings.txt. Directory entries also appear. A silent diff followed immediately by status 0 confirms the recorded content comparison; it does not compare permission bits.
8. Transfer and verify on the lab server
Section titled “8. Transfer and verify on the lab server”Goal: Read the SSH host fingerprint through the lab server’s console first. Compare the full fingerprint with the client’s first-connection prompt before accepting it. Transfer the archive as remote ~/capstone.tar.gz, then verify that copy from a remote shell.
Evidence: Keep the independent fingerprint, matching client fingerprint, local and remote pathnames, successful upload, full digests on both sides, and remote member list. Enter passwords only at the program’s password prompt; the terminal does not display them.
You pass this stage when the server identity is checked, the remote digest matches your local digest character for character, and remote tar lists the intended members. Transfer completion alone does not pass.
Hints: First SSH connection and SFTP.
Check your evidence: one possible verified transfer
learner@labserver:~$ ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub256 SHA256:/ym3ow3fUQzBWauSJ3rV5QTvs2zTSVsQvBhoWQf0viE root@labserver (ED25519)learner@labserver:~$ test ! -e ~/capstone.tar.gz && printf 'Remote destination absent\n'Remote destination absentlearner@labserver:~$ Steps (6)
- Type
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub - Press Enter — Obtain the full server fingerprint independently
- Output:
256 SHA256:/ym3ow3fUQzBWauSJ3rV5QTvs2zTSVsQvBhoWQf0viE root@labserver (ED25519) - Type
test ! -e ~/capstone.tar.gz && printf 'Remote destination absent\n' - Press Enter — Confirm that the reserved upload will not overwrite a remote file
- Output:
Remote destination absent
learner@rootvolt:~/lab/capstone$ sftp learner@labserverThe authenticity of host 'labserver (172.19.0.2)' can't be established.
ED25519 key fingerprint is SHA256:/ym3ow3fUQzBWauSJ3rV5QTvs2zTSVsQvBhoWQf0viE.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yesWarning: Permanently added 'labserver' (ED25519) to the list of known hosts.
learner@labserver's password: Connected to labserver.
sftp> lpwdLocal working directory: /home/learner/lab/capstone
sftp> pwdRemote working directory: /home/learner
sftp> put bundle.tar.gz capstone.tar.gzUploading bundle.tar.gz to /home/learner/capstone.tar.gz
bundle.tar.gz 100% 514 1.2MB/s 00:00
sftp> byelearner@rootvolt:~/lab/capstone$ Steps (20)
- Type
sftp learner@labserver - Press Enter — Compare the complete fingerprint with the trusted console before accepting
- Output:
The authenticity of host 'labserver (172.19.0.2)' can't be established. ED25519 key fingerprint is SHA256:/ym3ow3fUQzBWauSJ3rV5QTvs2zTSVsQvBhoWQf0viE. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])? - Type
yesinto the running program - Press Enter — Accept the matching host identity
- Output:
Warning: Permanently added 'labserver' (ED25519) to the list of known hosts. learner@labserver's password: - Type the password (the terminal shows nothing)
- Press Enter — Authenticate to SFTP with the hidden lab password
- Output:
Connected to labserver. sftp> - Type
lpwdinto the running program - Press Enter — Identify the local source directory
- Output:
Local working directory: /home/learner/lab/capstone sftp> - Type
pwdinto the running program - Press Enter — Identify the remote destination directory
- Output:
Remote working directory: /home/learner sftp> - Type
put bundle.tar.gz capstone.tar.gzinto the running program - Press Enter — Upload the local archive into the remote home directory
- Output:
Uploading bundle.tar.gz to /home/learner/capstone.tar.gz bundle.tar.gz 100% 514 1.2MB/s 00:00 sftp> - Type
byeinto the running program - Press Enter — Close SFTP and return to the local shell
learner@rootvolt:~/lab/capstone$ ssh learner@labserverlearner@labserver's password: Welcome to Ubuntu 24.04.5 LTS (GNU/Linux 6.18.33.1-microsoft-standard-WSL2 x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.learner@labserver:~$ sha256sum ~/capstone.tar.gzcfcaa01933a26a70548ae039f17a96375ace2c9fda6b164795356c078badb676 /home/learner/capstone.tar.gzlearner@labserver:~$ tar -tf ~/capstone.tar.gzbundle/
bundle/results/
bundle/results/warnings.txt
bundle/notes/
bundle/notes/vim.txt
bundle/notes/nano.txt
bundle/logs/
bundle/logs/activity.loglearner@labserver:~$ rm ~/capstone.tar.gzlearner@labserver:~$ test ! -e ~/capstone.tar.gz && printf 'Remote upload absent\n'Remote upload absentlearner@labserver:~$ exitlogout
Connection to labserver closed.learner@rootvolt:~/lab/capstone$ Steps (20)
- Type
ssh learner@labserver - Press Enter — Open a remote shell on the already verified host
- Output:
learner@labserver's password: - Type the password (the terminal shows nothing)
- Press Enter — Authenticate again to reach the remote shell
- Output:
Welcome to Ubuntu 24.04.5 LTS (GNU/Linux 6.18.33.1-microsoft-standard-WSL2 x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/pro To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details. - Type
sha256sum ~/capstone.tar.gz - Press Enter — Compare the complete remote digest with the local digest
- Output:
cfcaa01933a26a70548ae039f17a96375ace2c9fda6b164795356c078badb676 /home/learner/capstone.tar.gz - Type
tar -tf ~/capstone.tar.gz - Press Enter — Verify the remote archive has the intended members
- Output:
bundle/ bundle/results/ bundle/results/warnings.txt bundle/notes/ bundle/notes/vim.txt bundle/notes/nano.txt bundle/logs/ bundle/logs/activity.log - Type
rm ~/capstone.tar.gz - Press Enter — Remove the uploaded archive on the server
- Type
test ! -e ~/capstone.tar.gz && printf 'Remote upload absent\n' - Press Enter — Confirm the remote upload is absent
- Output:
Remote upload absent - Type
exit - Press Enter — Leave the remote shell before cleaning local files
- Output:
logout Connection to labserver closed.
| Side | Archive pathname |
|---|---|
| LOCAL rootvolt | ~/lab/capstone/bundle.tar.gz |
| REMOTE labserver | ~/capstone.tar.gz |
The complete matching digest in this run is cfcaa01933a26a70548ae039f17a96375ace2c9fda6b164795356c078badb676. Use your own matching pair: archive metadata makes this value change between runs.
9. Reset and preserve your evidence
Section titled “9. Reset and preserve your evidence”Goal: Save your hand-in separately. Remove only the reserved remote upload, local archive, original workspace, and recovery-test copy. Inspect paths before removing their files, and use empty-directory removal for directories. Remove only the saved host keys for labserver and verify their absence, following the SSH reset explanation.
Evidence: Keep the remote absence check before leaving SSH, local workspace absence check, package removal check, and host-key lookup after removal.
You pass this stage when the exercise paths and installed utility are absent, no saved key for labserver remains, and other lab files and SSH entries remain intact. APT’s refreshed indexes can remain. Keep the SSH directory and the host-key backup described in the linked reset guidance.
Check your evidence: one possible two-machine reset
The preceding remote verification recording removes the upload and checks its absence before returning to the local shell. The utility recording verifies package removal.
The local cleanup names each file it removes, two per command, then removes the emptied directories with rmdir, which refuses a directory that still holds something.
learner@rootvolt:~/lab/capstone$ cd restored/bundlelearner@rootvolt:~/lab/capstone/restored/bundle$ rm notes/nano.txt notes/vim.txtlearner@rootvolt:~/lab/capstone/restored/bundle$ rm logs/activity.log results/warnings.txtlearner@rootvolt:~/lab/capstone/restored/bundle$ rmdir notes logs resultslearner@rootvolt:~/lab/capstone/restored/bundle$ cd ../..learner@rootvolt:~/lab/capstone$ rmdir restored/bundle restoredlearner@rootvolt:~/lab/capstone$ rm bundle.tar.gzlearner@rootvolt:~/lab/capstone$ rm bundle/notes/nano.txt bundle/notes/vim.txtlearner@rootvolt:~/lab/capstone$ rm bundle/logs/activity.log bundle/results/warnings.txtlearner@rootvolt:~/lab/capstone$ rmdir bundle/notes bundle/logs bundle/results bundlelearner@rootvolt:~/lab/capstone$ cd ~/lablearner@rootvolt:~/lab$ rmdir capstonelearner@rootvolt:~/lab$ test ! -e capstone && printf 'Workspace absent\n'Workspace absentlearner@rootvolt:~/lab$ ssh-keygen -R labserver# Host labserver found: line 1
# Host labserver found: line 2
# Host labserver found: line 3
/home/learner/.ssh/known_hosts updated.
Original contents retained as /home/learner/.ssh/known_hosts.oldlearner@rootvolt:~/lab$ ssh-keygen -F labserver || printf 'No saved key for labserver\n'No saved key for labserverlearner@rootvolt:~/lab$ Steps (33)
- Type
cd restored/bundle - Press Enter — Enter the recovery-test bundle before deleting its known files
- Type
rm notes/nano.txt notes/vim.txt - Press Enter — Remove the two restored editor notes
- Type
rm logs/activity.log results/warnings.txt - Press Enter — Remove the restored log and warning result
- Type
rmdir notes logs results - Press Enter — Remove the empty recovered subdirectories
- Type
cd ../.. - Press Enter — Return to the workspace outside the recovery-test copy
- Type
rmdir restored/bundle restored - Press Enter — Remove the empty recovered bundle and extraction directory
- Type
rm bundle.tar.gz - Press Enter — Remove the local archive
- Type
rm bundle/notes/nano.txt bundle/notes/vim.txt - Press Enter — Remove the two known editor notes
- Type
rm bundle/logs/activity.log bundle/results/warnings.txt - Press Enter — Remove the synthetic log and saved warning result
- Type
rmdir bundle/notes bundle/logs bundle/results bundle - Press Enter — Remove the empty original directories
- Type
cd ~/lab - Press Enter — Return to the baseline lab
- Type
rmdir capstone - Press Enter — Remove the reserved workspace
- Type
test ! -e capstone && printf 'Workspace absent\n' - Press Enter — Verify the workspace is absent
- Output:
Workspace absent - Type
ssh-keygen -R labserver - Press Enter — Remove only labserver host keys
- Output:
# Host labserver found: line 1 # Host labserver found: line 2 # Host labserver found: line 3 /home/learner/.ssh/known_hosts updated. Original contents retained as /home/learner/.ssh/known_hosts.old - Type
ssh-keygen -F labserver || printf 'No saved key for labserver\n' - Press Enter — Check that labserver has no saved key
- Output:
No saved key for labserver
The earlier workspace recording also resets its own files:
learner@rootvolt:~/lab/capstone$ rm bundle/notes/nano.txt bundle/notes/vim.txtlearner@rootvolt:~/lab/capstone$ rm bundle/logs/activity.log bundle/results/warnings.txtlearner@rootvolt:~/lab/capstone$ rmdir bundle/notes bundle/logs bundle/results bundlelearner@rootvolt:~/lab/capstone$ cd ~/lablearner@rootvolt:~/lab$ rmdir capstonelearner@rootvolt:~/lab$ test ! -e capstone && printf 'Workspace absent\n'Workspace absentlearner@rootvolt:~/lab$ Steps (13)
- Type
rm bundle/notes/nano.txt bundle/notes/vim.txt - Press Enter — Remove the two known editor notes
- Type
rm bundle/logs/activity.log bundle/results/warnings.txt - Press Enter — Remove the synthetic log and saved warning result
- Type
rmdir bundle/notes bundle/logs bundle/results bundle - Press Enter — Remove only empty exercise directories
- Type
cd ~/lab - Press Enter — Leave the exercise workspace
- Type
rmdir capstone - Press Enter — Remove the empty reserved directory
- Type
test ! -e capstone && printf 'Workspace absent\n' - Press Enter — Check that the workspace is absent
- Output:
Workspace absent
Recall check
Section titled “Recall check”- What did the failed directory change leave unchanged?
- Why did the owner triplet apply to the failed read of
nano.txt, and which permission was missing? - What does a silent recursive comparison establish, and what must you inspect separately?
- Why check both the SSH host fingerprint and the archive digest?
- Which cleanup checks run remotely, and which run locally?
Answers
- The current directory and filesystem contents stayed unchanged; the target path did not exist.
- The file owner was
learner, the account runningcat, so the owner triplet applied. Its-w-triplet in--w-------lackedr; restoring owner read permission allowed the read. - Status 0 with no differences establishes matching compared contents and structure. Check modes separately.
- The fingerprint checks the server’s identity; matching local and remote digests check the transferred archive’s bytes.
- Remove and check the uploaded archive remotely. Check the local workspace, exercise package, and saved server host key locally.
Keep your evidence as a record of the workspace you built. The Linux course overview shows the course plan beyond Beginner.
Further reading
Section titled “Further reading”- On Ubuntu:
man chmod,man grep,man tree,man apt,man tar,man diff,man sha256sum,man ssh, andman sftp. - GNU tar manual.
- GNU Nano manual and Vim’s built-in
:help. - Ubuntu APT manual.
- OpenSSH documentation.