Practice: Basic Connectivity and Remote Access
On this page
A teammate needs a copy of the lab server’s web greeting in their remote home directory. Your handoff must show that you reached the intended server, transferred the intended content, and left no practice copies behind. A successful ping alone cannot establish that work.
Combine the module’s skills in one short scenario. Use the lessons and manuals as needed, and attempt the goals before opening the solution.
Before you start
Section titled “Before you start”Finish Transferring files with SFTP and its reset. Begin locally in ~/lab, from the B04 setup. Use the prepared lab server. Reserve absent local ~/lab/b14-practice and remote ~/b14-handoff directories.
The recording uses a private Docker bridge between two containers, rootvolt and labserver, not a home network. Labserver resolves inside that prepared environment. On your own VM, you need a second machine you control, with an SSH server and console access.
Your IP and MAC addresses, interface names and indexes, routes, listener ports used by Docker, ping times, HTTP Date headers, fingerprints, and transfer speeds will differ. The SSH banner names the lab container’s shared WSL2 kernel; your banner names your own system and kernel. Each capture’s fresh server has a different host key. Compare the console and client from the same server run.
The practice starts its own lab server; a key saved during the transfer lesson belongs to an earlier server run. Use the SSH lesson’s console check and reset guidance before accepting this practice server’s identity.
Your task
Section titled “Your task”Reach these six goals:
- Identify the local non-loopback interface, its IPv4 address, the connected route, and the default gateway. Resolve labserver and send two bounded ICMP probes. Explain which route applies to the server and what the replies establish.
- Inspect local TCP listeners. Later inspect the server’s listeners from its remote shell. Distinguish these observations from a test of whether a client request succeeds.
- Inspect HTTP headers for
/hello.txt, save its body locally asbriefing.txtwith curl, and save the same resource asreference.txtwith wget. Read both files and distinguish their body text from the transfer reports. - Read the server’s ED25519 host-key fingerprint through its trusted console. Compare it with the SFTP client’s first-connection prompt before accepting it, then authenticate to learner. Upload briefing.txt into remote
~/b14-handoff/briefing.txtand download a copy as localreturned.txt. - Verify returned.txt locally. Open an SSH shell on the same server, establish the remote machine and directory, inspect its TCP listeners, and read the uploaded file there. Explain why all three pathname locations are separate copies.
- Remove the remote upload and its empty directory, end the SSH session, and remove all three local downloads and their empty directory. Remove only labserver’s saved host keys and confirm none remain. Prove both exercise directories are absent.
Predict before transferring: will downloading the upload remove it from the server?
Run it, then compare with your guess
No. Downloading creates another copy. Remote removal is a separate reset step after verification, and the local source remains until you remove it.
Expected evidence
Section titled “Expected evidence”- An address and route identify the local path, while a resolved address identifies the destination. A connected-network route can take precedence over the default route.
- Two ping replies in this capture establish successful ICMP exchanges at that moment. An unanswered ping alone would not prove a host is down.
- The headers report a successful HTTP response and a 73-byte plain-text resource. Both local saves contain the greeting, not HTTP headers or progress-meter text.
- The client fingerprint matches the independent console reading from this run. Passwords remain hidden. No trust-check bypass is needed.
- SFTP reports separate local and remote working directories. The uploaded file and returned copy contain the same two lines as the web resource.
- The SSH prompt names labserver, its listeners include TCP ports 22 and 80, and the uploaded body is readable there. After exit, the local prompt names rootvolt again.
- Remote and local absence checks succeed. No saved key for labserver remains; other SSH entries and the directory stay.
Hint for the connectivity evidence
Read inet under the non-loopback interface. Follow dev in the route listing, and compare the server address with the connected prefix. Do not substitute the recorded address into your settings. Run ss on each machine whose listeners you need to inspect.
Hint for identity and transfer directions
Use the server console before the first client connection. Compare the complete fingerprint. At sftp>, lpwd is local and pwd is remote. Put takes a local source first; get takes a remote source first.
Hint for the reset
Remove the remote copy while still in the remote shell, then exit before local cleanup. Check the host in the prompt each time. Use ssh-keygen -R labserver to remove only the lab server’s saved keys, then check with ssh-keygen -F labserver.
Solution
Section titled “Solution”Solution
Read the identity through the trusted server console.
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.publearner@labserver:~$ ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub256 SHA256:rF3fo0ge9FMatMKLGoyugQ0B+sqCvcltsVZ9EJqL9iA root@labserver (ED25519)learner@labserver:~$ Steps (3)
- Type
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub - Press Enter
- Output:
256 SHA256:rF3fo0ge9FMatMKLGoyugQ0B+sqCvcltsVZ9EJqL9iA root@labserver (ED25519)
Keep the SHA256 fingerprint available. You will compare the whole value, not its comment or the server address.
Prepare locally and inspect the path.
mkdir ~/lab/b14-practicecd ~/lab/b14-practiceip addressip routegetent hosts labserverping -c 2 labserverss -ltnlearner@rootvolt:~/lab/b14-practice$ ip address1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0@if233: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 26:14:e4:2b:ec:e3 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.19.0.3/16 brd 172.19.255.255 scope global eth0
valid_lft forever preferred_lft foreverlearner@rootvolt:~/lab/b14-practice$ ip routedefault via 172.19.0.1 dev eth0
172.19.0.0/16 dev eth0 proto kernel scope link src 172.19.0.3 learner@rootvolt:~/lab/b14-practice$ getent hosts labserver172.19.0.2 labserverlearner@rootvolt:~/lab/b14-practice$ ping -c 2 labserverPING labserver (172.19.0.2) 56(84) bytes of data.
64 bytes from labserver.rootvolt-lab (172.19.0.2): icmp_seq=1 ttl=64 time=0.149 ms
64 bytes from labserver.rootvolt-lab (172.19.0.2): icmp_seq=2 ttl=64 time=0.153 ms
--- labserver ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.149/0.151/0.153/0.002 mslearner@rootvolt:~/lab/b14-practice$ Steps (12)
- Type
ip address - Press Enter
- Output:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0@if233: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 26:14:e4:2b:ec:e3 brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet 172.19.0.3/16 brd 172.19.255.255 scope global eth0 valid_lft forever preferred_lft forever - Type
ip route - Press Enter
- Output:
default via 172.19.0.1 dev eth0 172.19.0.0/16 dev eth0 proto kernel scope link src 172.19.0.3 - Type
getent hosts labserver - Press Enter
- Output:
172.19.0.2 labserver - Type
ping -c 2 labserver - Press Enter
- Output:
PING labserver (172.19.0.2) 56(84) bytes of data. 64 bytes from labserver.rootvolt-lab (172.19.0.2): icmp_seq=1 ttl=64 time=0.149 ms 64 bytes from labserver.rootvolt-lab (172.19.0.2): icmp_seq=2 ttl=64 time=0.153 ms --- labserver ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.149/0.151/0.153/0.002 ms
The recorded route uses eth0 for the connected network. Its default route is a separate fallback. The address returned for labserver belongs to the connected network, so this traffic does not need the default gateway. Your values can differ; explain the relationship from your own output.
The full capture also records local ss: it has a loopback resolver listener at 127.0.0.11, rather than the server’s port-22 and port-80 listeners. Read Local Address:Port and LISTEN, not the wildcard peer as if it were a client. The later server-side ss supplies the other machine’s socket evidence.
Retrieve the handoff text.
curl -sS -I http://labserver/hello.txtcurl -sS --fail -o briefing.txt http://labserver/hello.txtcat briefing.txtwget -O reference.txt http://labserver/hello.txtcat reference.txtlearner@rootvolt:~/lab/b14-practice$ curl -sS -I http://labserver/hello.txtHTTP/1.0 200 OK
Server: SimpleHTTP/0.6 Python/3.12.3
Date: Sun, 15 Nov 2026 17:51:54 GMT
Content-type: text/plain
Content-Length: 73
Last-Modified: Sun, 15 Nov 2026 00:00:00 GMTlearner@rootvolt:~/lab/b14-practice$ curl -sS --fail -o briefing.txt http://labserver/hello.txtlearner@rootvolt:~/lab/b14-practice$ cat briefing.txtHello from the RootVolt lab server.
This text file is served on port 80.learner@rootvolt:~/lab/b14-practice$ wget -O reference.txt http://labserver/hello.txt--2026-11-15 17:51:55-- http://labserver/hello.txt
Resolving labserver (labserver)... 172.19.0.2
Connecting to labserver (labserver)|172.19.0.2|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 73 [text/plain]
Saving to: ‘reference.txt’
reference.txt 100%[===================>] 73 --.-KB/s in 0s
2026-11-15 17:51:55 (37.1 MB/s) - ‘reference.txt’ saved [73/73]learner@rootvolt:~/lab/b14-practice$ cat reference.txtHello from the RootVolt lab server.
This text file is served on port 80.learner@rootvolt:~/lab/b14-practice$ Steps (14)
- Type
curl -sS -I http://labserver/hello.txt - Press Enter
- Output:
HTTP/1.0 200 OK Server: SimpleHTTP/0.6 Python/3.12.3 Date: Sun, 15 Nov 2026 17:51:54 GMT Content-type: text/plain Content-Length: 73 Last-Modified: Sun, 15 Nov 2026 00:00:00 GMT - Type
curl -sS --fail -o briefing.txt http://labserver/hello.txt - Press Enter
- Type
cat briefing.txt - Press Enter
- Output:
Hello from the RootVolt lab server. This text file is served on port 80. - Type
wget -O reference.txt http://labserver/hello.txt - Press Enter
- Output:
--2026-11-15 17:51:55-- http://labserver/hello.txt Resolving labserver (labserver)... 172.19.0.2 Connecting to labserver (labserver)|172.19.0.2|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 73 [text/plain] Saving to: ‘reference.txt’ reference.txt 100%[===================>] 73 --.-KB/s in 0s 2026-11-15 17:51:55 (37.1 MB/s) - ‘reference.txt’ saved [73/73] - Type
cat reference.txt - Press Enter
- Output:
Hello from the RootVolt lab server. This text file is served on port 80.
The status line reports 200 OK; Content-Length reports 73. The Date header varies. Curl writes the body to briefing.txt; wget writes it to reference.txt and prints a transfer report separately. Both cat commands show the greeting’s two lines. Using --fail makes curl treat HTTP error responses as a failure rather than accepting an error body as the handoff.
Upload and download through the verified server.
From the local shell:
sftp learner@labserverCompare its ED25519 SHA256 fingerprint with the trusted console. If it matches, answer yes and authenticate with the lab password, which is hidden while typed. If it differs, stop and investigate. At sftp>, enter:
lpwdpwdmkdir b14-handoffput briefing.txt b14-handoff/briefing.txtget b14-handoff/briefing.txt returned.txtls b14-handoffbyeAfter bye, read the downloaded destination locally:
cat returned.txtlearner@rootvolt:~/lab/b14-practice$ sftp learner@labserverThe authenticity of host 'labserver (172.19.0.2)' can't be established.
ED25519 key fingerprint is SHA256:rF3fo0ge9FMatMKLGoyugQ0B+sqCvcltsVZ9EJqL9iA.
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/b14-practice
sftp> pwdRemote working directory: /home/learner
sftp> mkdir b14-handoffsftp> put briefing.txt b14-handoff/briefing.txtUploading briefing.txt to /home/learner/b14-handoff/briefing.txt
briefing.txt 100% 73 203.2KB/s 00:00
sftp> get b14-handoff/briefing.txt returned.txtFetching /home/learner/b14-handoff/briefing.txt to returned.txt
briefing.txt 100% 73 22.0KB/s 00:00
sftp> ls b14-handoffb14-handoff/briefing.txt
sftp> byelearner@rootvolt:~/lab/b14-practice$ cat returned.txtHello from the RootVolt lab server.
This text file is served on port 80.learner@rootvolt:~/lab/b14-practice$ Steps (32)
- Type
sftp learner@labserver - Press Enter — Compare the whole fingerprint with the server console before answering
- Output:
The authenticity of host 'labserver (172.19.0.2)' can't be established. ED25519 key fingerprint is SHA256:rF3fo0ge9FMatMKLGoyugQ0B+sqCvcltsVZ9EJqL9iA. 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
- 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
- Output:
Connected to labserver. sftp> - Type
lpwdinto the running program - Press Enter
- Output:
Local working directory: /home/learner/lab/b14-practice sftp> - Type
pwdinto the running program - Press Enter
- Output:
Remote working directory: /home/learner sftp> - Type
mkdir b14-handoffinto the running program - Press Enter
- Output:
sftp> - Type
put briefing.txt b14-handoff/briefing.txtinto the running program - Press Enter
- Output:
Uploading briefing.txt to /home/learner/b14-handoff/briefing.txt briefing.txt 100% 73 203.2KB/s 00:00 sftp> - Type
get b14-handoff/briefing.txt returned.txtinto the running program - Press Enter
- Output:
Fetching /home/learner/b14-handoff/briefing.txt to returned.txt briefing.txt 100% 73 22.0KB/s 00:00 sftp> - Type
ls b14-handoffinto the running program - Press Enter
- Output:
b14-handoff/briefing.txt sftp> - Type
byeinto the running program - Press Enter
- Type
cat returned.txt - Press Enter
- Output:
Hello from the RootVolt lab server. This text file is served on port 80.
| Side | Source or destination |
|---|---|
| Local rootvolt | /home/learner/lab/b14-practice/briefing.txt is the upload source; returned.txt in the same directory is the download destination |
| Remote labserver | /home/learner/b14-handoff/briefing.txt is the upload destination and subsequent download source |
Ls still finds the uploaded file after get. The returned copy’s content matches the original greeting. Neither transfer operation removes its source.
Check the remote destination and reset the server.
At the local shell, start SSH and authenticate:
ssh learner@labserverThis uses the host identity accepted during the same SFTP run; it does not ask you to accept a different host key. At the remote shell:
hostname; pwdss -ltncat ~/b14-handoff/briefing.txtrm ~/b14-handoff/briefing.txtrmdir ~/b14-handofftest ! -e ~/b14-handoff && printf 'Remote reset complete\n'exitlearner@rootvolt:~/lab/b14-practice$ 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:~$ hostname; pwdlabserver
/home/learnerlearner@labserver:~$ cat ~/b14-handoff/briefing.txtHello from the RootVolt lab server.
This text file is served on port 80.learner@labserver:~$ rm ~/b14-handoff/briefing.txtlearner@labserver:~$ rmdir ~/b14-handofflearner@labserver:~$ test ! -e ~/b14-handoff && printf 'Remote reset complete\n'Remote reset completelearner@labserver:~$ exitlogout
Connection to labserver closed.learner@rootvolt:~/lab/b14-practice$ Steps (22)
- Type
ssh learner@labserver - Press Enter
- Output:
learner@labserver's password: - Type the password (the terminal shows nothing)
- Press Enter
- 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
hostname; pwd - Press Enter
- Output:
labserver /home/learner - Type
cat ~/b14-handoff/briefing.txt - Press Enter
- Output:
Hello from the RootVolt lab server. This text file is served on port 80. - Type
rm ~/b14-handoff/briefing.txt - Press Enter
- Type
rmdir ~/b14-handoff - Press Enter
- Type
test ! -e ~/b14-handoff && printf 'Remote reset complete\n' - Press Enter
- Output:
Remote reset complete - Type
exit - Press Enter
- Output:
logout Connection to labserver closed.
The replay selects the identity, content, and reset steps. The full capture also records server ss between the identity and content checks. It shows 0.0.0.0:22, [::]:22, and 0.0.0.0:80 as listeners, plus Docker’s internal resolver listener. The local and remote ss commands inspect different socket tables. A listener does not by itself prove every client can reach it; this solution also records successful HTTP, SFTP, and SSH client interactions.
Reset the local side.
At the restored local prompt:
rm briefing.txt reference.txt returned.txtcd ~/labrmdir ~/lab/b14-practicels -a ~/.sshssh-keygen -R labserverssh-keygen -F labserver || printf 'No saved key for labserver\n'test ! -e ~/lab/b14-practice && printf 'Local reset complete\n'learner@rootvolt:~/lab/b14-practice$ rm briefing.txt reference.txt returned.txtlearner@rootvolt:~/lab/b14-practice$ cd ~/lablearner@rootvolt:~/lab$ rmdir ~/lab/b14-practicelearner@rootvolt:~/lab$ ls -a ~/.ssh. .. known_hosts known_hosts.oldlearner@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$ test ! -e ~/lab/b14-practice && printf 'Local reset complete\n'Local reset completelearner@rootvolt:~/lab$ Steps (18)
- Type
rm briefing.txt reference.txt returned.txt - Press Enter
- Type
cd ~/lab - Press Enter
- Type
rmdir ~/lab/b14-practice - Press Enter
- Type
ls -a ~/.ssh - Press Enter — Inspect the SSH directory before removing the labserver entry
- Output:
. .. known_hosts known_hosts.old - Type
ssh-keygen -R labserver - Press Enter — Remove only saved host keys for labserver
- 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 — Confirm no saved key for labserver remains
- Output:
No saved key for labserver - Type
test ! -e ~/lab/b14-practice && printf 'Local reset complete\n' - Press Enter — Confirm the local exercise reset is complete
- Output:
Local reset complete
The final lookup checks labserver trust separately from the absence test for the three downloads’ directory. The SSH reset explanation describes why the remaining trust file and backup are kept.
Both empty-directory removals and final absence tests succeed. The fixed web resource on the server was only read and needs no reset.
Recall check
Section titled “Recall check”1. What is the difference between the interface name, its IPv4 address, and a TCP port?
Answer
The interface is a network attachment. Its IP address identifies a network-layer endpoint. A TCP port identifies a transport endpoint at that address, such as the listening SSH service.
2. Why can traffic to the server avoid the default gateway even when a default route exists?
Answer
A more specific connected route matches the server address here. The default route is the fallback when no more specific route applies.
3. What does unanswered ping fail to establish, and what does a local ss listing fail to describe?
Answer
Unanswered ICMP requests alone do not prove the host is down. A local ss listing describes local sockets, not the remote server’s socket table. Use a client service request and server-side observations to investigate further.
4. How do a headers-only request and a saved body differ?
Answer
Headers describe the response, including status, content type, and reported size. The body contains the resource bytes. The saved greeting should contain the text itself, not a progress report or headers.
5. Why does account authentication come after the server identity check?
Answer
The fingerprint check establishes which server you are trusting. Authentication then establishes access to the requested account. Knowing the account password does not independently identify the server.
6. Which copies remain after get, and which reset must happen before exit?
Answer
The original local file, remote upload, and local download all remain. Remove the remote upload and its directory at the remote shell before exit in this solution. Then remove local copies after the local prompt returns.
Reset this lesson
Section titled “Reset this lesson”Goal 6 and the solution’s final two sections are the recorded reset. They verify remote pathname removal, close the remote shell, remove local exercise copies, and remove only labserver’s saved host keys. The SSH directory, other entries, and backup remain.
- Separate name resolution, routing, ICMP replies, and service evidence.
- Distinguish response headers, body bytes, and transfer reports.
- Verify the server before authenticating, and read the host in each shell prompt.
- Label transfer directions, verify destination contents, and reset both machines.
Next, Archives versus compression separates packaging files from reducing their size.
Further reading
Section titled “Further reading”- On Ubuntu:
man ip-address,man ip-route,man ping,man ss,man curl,man wget,man ssh, andman sftp. - Ubuntu SSH manual and SFTP manual.
- curl manual and GNU Wget download options.