Skip to content

A teammate needs the error from a project log, together with the source that explains it. Sending only a pasted line loses its context. By the end, you can prepare a project handoff, transfer one archive, and check the bytes on the receiving machine.

Finish Checksums and differences and Transferring files with SFTP, including their resets. Use ~/lab from the practice directory setup, and the prepared lab server.

Reserve local ~/lab/b15-workflow and remote ~/b15-workflow.tar.gz; both must be absent. The lab hostname labserver resolves in the prepared private network. Your addresses, fingerprints, transfer speeds, and listing dates will differ. The SSH banner in this container names a WSL2 kernel; your login banner names your own system and kernel.

This workflow uploads to a recreated lab server, whose key differs from earlier transfer exercises. If an earlier labserver entry remains, use the console verification and trust-reset procedure before starting SFTP.

Organize the source and results separately. Locate the information before saving a result. Inspect the packaged project before transferring it. Finally, check the received archive on the remote machine.

Five workflow stages Organize files, locate information, save a result, package the project, and transfer the archive. Organize Locate Save a result Package Transfer
Five workflow stages Organize files, locate information, save a result, package the project, and transfer the archive. Organize Locate Save a result Package Transfer
Five stages take a local project from organized files through a saved result and archive to a remote transfer.

Each stage has a replay from the same recorded workflow:

Stage Recorded commands
Organize Create the local layout and input
Locate Find the log and matching line
Save a result Write and read the filtered result
Package Archive, inspect, and hash
Transfer Authenticate and upload

At the local shell, create the workspace:

Terminal window
mkdir ~/lab/b15-workflow
cd ~/lab/b15-workflow
mkdir -p report/inbox report/results

Use your editor to write this synthetic log, including its final newline:

report/inbox/events.log
INFO start
ERROR sensor offline
INFO end

The recording uses printf to write the same text. Inbox holds the supplied input; results holds output you derive from it. This separation keeps a saved result from being confused with its source.

Organize: project workflow
learner@rootvolt:~/lab$ mkdir ~/lab/b15-workflowlearner@rootvolt:~/lab$ cd ~/lab/b15-workflowlearner@rootvolt:~/lab/b15-workflow$ mkdir -p report/inbox report/resultslearner@rootvolt:~/lab/b15-workflow$ printf '%s\n' 'INFO start' 'ERROR sensor offline' 'INFO end' > report/inbox/events.loglearner@rootvolt:~/lab/b15-workflow$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. LOCAL organize stage: create the report directories and the synthetic source log.
Steps (8)
  1. Type mkdir ~/lab/b15-workflow
  2. Press Enter — Reserve the local workspace
  3. Type cd ~/lab/b15-workflow
  4. Press Enter — Enter the local workspace
  5. Type mkdir -p report/inbox report/results
  6. Press Enter — Separate the source notes from derived results
  7. Type printf '%s\n' 'INFO start' 'ERROR sensor offline' 'INFO end' > report/inbox/events.log
  8. Press Enter — Write the synthetic input log

First locate the file, then locate the text inside it:

Terminal window
find report -type f -name '*.log'
grep -n 'ERROR' report/inbox/events.log

Quotes keep Bash from expanding the filename pattern before find sees it. Find searches names; grep searches contents. Grep’s -n adds a line number so you can return to the source entry.

Locate: project workflow
learner@rootvolt:~/lab/b15-workflow$ find report -type f -name '*.log'report/inbox/events.loglearner@rootvolt:~/lab/b15-workflow$ grep -n 'ERROR' report/inbox/events.log2:ERROR sensor offlinelearner@rootvolt:~/lab/b15-workflow$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. LOCAL locate stage: find identifies the log pathname, and grep identifies the error on line 2.
Steps (6)
  1. Type find report -type f -name '*.log'
  2. Press Enter — Locate the log by name under the project
  3. Output: report/inbox/events.log
  4. Type grep -n 'ERROR' report/inbox/events.log
  5. Press Enter — Locate the matching line with its line number
  6. Output: 2:ERROR sensor offline

Keep only matching log text in the result file:

Terminal window
grep 'ERROR' report/inbox/events.log > report/results/errors.txt
cat report/results/errors.txt

This grep omits -n because the result should contain the log entry itself. Redirection creates the result; it would replace an existing file at that pathname. Read the saved file rather than assuming a quiet command saved the intended text.

Save: project workflow
learner@rootvolt:~/lab/b15-workflow$ grep 'ERROR' report/inbox/events.log > report/results/errors.txtlearner@rootvolt:~/lab/b15-workflow$ cat report/results/errors.txtERROR sensor offlinelearner@rootvolt:~/lab/b15-workflow$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. LOCAL save stage: write the selected error into results/errors.txt and read it back.
Steps (5)
  1. Type grep 'ERROR' report/inbox/events.log > report/results/errors.txt
  2. Press Enter — Save matching text without line-number decoration
  3. Type cat report/results/errors.txt
  4. Press Enter — Read the saved result before packaging
  5. Output: ERROR sensor offline

From the local workspace directory:

Terminal window
tar -czf report.tar.gz report
tar -tf report.tar.gz
sha256sum report.tar.gz

The archive is outside report, so it cannot include itself. Its member list includes the source log and saved result. The digest describes this exact archive, including its stored metadata. Recreating an archive later can produce a different digest even if visible text is unchanged. Compare the transferred copy with this local archive.

Package: project workflow
learner@rootvolt:~/lab/b15-workflow$ tar -czf report.tar.gz reportlearner@rootvolt:~/lab/b15-workflow$ tar -tf report.tar.gzreport/
report/results/
report/results/errors.txt
report/inbox/
report/inbox/events.loglearner@rootvolt:~/lab/b15-workflow$ sha256sum report.tar.gz75d43560a9c0dc21899e880384d179f5e4b976880835963967077247aadde86c  report.tar.gzlearner@rootvolt:~/lab/b15-workflow$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. LOCAL package stage: create the compressed archive, inspect both branches, and compute its complete digest.
Steps (8)
  1. Type tar -czf report.tar.gz report
  2. Press Enter — Package the source and saved result together
  3. Type tar -tf report.tar.gz
  4. Press Enter — Inspect the archive members before transferring
  5. Output: report/ report/results/ report/results/errors.txt report/inbox/ report/inbox/events.log
  6. Type sha256sum report.tar.gz
  7. Press Enter — Record the local digest for remote comparison
  8. Output: 75d43560a9c0dc21899e880384d179f5e4b976880835963967077247aadde86c report.tar.gz

Read the server fingerprint through its console

Section titled “Read the server fingerprint through its console”

On the trusted server console, check the identity and reserved destination before connecting:

Terminal window
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
test ! -e ~/b15-workflow.tar.gz && printf 'Remote destination absent\n'
Server console: read the transfer host fingerprint
learner@labserver:~$ ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub256 SHA256:jdEs6/lqiaafQBHCkrrMXQbBAh08WGvqo791Uqx9vO8 root@labserver (ED25519)learner@labserver:~$ test ! -e ~/b15-workflow.tar.gz && printf 'Remote destination absent\n'Remote destination absentlearner@labserver:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS (lab server console), GNU Bash 5.2.21. SERVER console: read the identity independently and check that the upload name is unused.
Steps (6)
  1. Type ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
  2. Press Enter — Obtain the full server fingerprint independently
  3. Output: 256 SHA256:jdEs6/lqiaafQBHCkrrMXQbBAh08WGvqo791Uqx9vO8 root@labserver (ED25519)
  4. Type test ! -e ~/b15-workflow.tar.gz && printf 'Remote destination absent\n'
  5. Press Enter — Confirm that the reserved upload will not overwrite a remote file
  6. Output: Remote destination absent

Only use the destination if its absence check succeeds. The server gets a separate host key for this recording, so another lesson’s fingerprint cannot verify this capture.

From the local shell in the workspace:

Terminal window
sftp learner@labserver

Compare the entire ED25519 SHA256 fingerprint with the console value. If it differs, stop and investigate through the console. If it matches, answer yes and enter the lab password at the hidden password prompt. The prepared lab account uses learner as its password.

At sftp>, enter:

Commands typed at sftp>
lpwd
pwd
put report.tar.gz b15-workflow.tar.gz
bye
Transfer: project workflow
learner@rootvolt:~/lab/b15-workflow$ sftp learner@labserverThe authenticity of host 'labserver (172.19.0.2)' can't be established.
ED25519 key fingerprint is SHA256:jdEs6/lqiaafQBHCkrrMXQbBAh08WGvqo791Uqx9vO8.
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/b15-workflow
sftp> pwdRemote working directory: /home/learner
sftp> put report.tar.gz b15-workflow.tar.gzUploading report.tar.gz to /home/learner/b15-workflow.tar.gz
report.tar.gz                                 100%  268   851.5KB/s   00:00    
sftp> byelearner@rootvolt:~/lab/b15-workflow$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. Transfer stage: confirm host identity, authenticate, label the two directories, and upload the local archive to the remote home.
Steps (20)
  1. Type sftp learner@labserver
  2. Press Enter — Compare the complete fingerprint with the trusted console before accepting
  3. Output: The authenticity of host 'labserver (172.19.0.2)' can't be established. ED25519 key fingerprint is SHA256:jdEs6/lqiaafQBHCkrrMXQbBAh08WGvqo791Uqx9vO8. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])?
  4. Type yes into the running program
  5. Press Enter — Accept the matching host identity
  6. Output: Warning: Permanently added 'labserver' (ED25519) to the list of known hosts. learner@labserver's password:
  7. Type the password (the terminal shows nothing)
  8. Press Enter — Authenticate to SFTP with the hidden lab password
  9. Output: Connected to labserver. sftp>
  10. Type lpwd into the running program
  11. Press Enter — Identify the local source directory
  12. Output: Local working directory: /home/learner/lab/b15-workflow sftp>
  13. Type pwd into the running program
  14. Press Enter — Identify the remote destination directory
  15. Output: Remote working directory: /home/learner sftp>
  16. Type put report.tar.gz b15-workflow.tar.gz into the running program
  17. Press Enter — Upload the local archive into the remote home directory
  18. Output: Uploading report.tar.gz to /home/learner/b15-workflow.tar.gz report.tar.gz 100% 268 851.5KB/s 00:00 sftp>
  19. Type bye into the running program
  20. Press Enter — Close SFTP and return to the local shell
Side Archive pathname
Local rootvolt ~/lab/b15-workflow/report.tar.gz
Remote labserver ~/b15-workflow.tar.gz

Lpwd reports the local directory. SFTP’s pwd reports the remote directory. Put copies the local source into that remote home; bye returns to the local shell.

Verify the received bytes and reset the server

Section titled “Verify the received bytes and reset the server”

Predict: does a completed upload prove that its archive contains the files you intended to send?

Run it, then compare with your guess

Open an SSH shell from the local prompt, then check the remote copy:

Terminal window
ssh learner@labserver

Authenticate with the hidden lab password again. This connection recognizes the host already accepted in SFTP. At the remote shell:

Terminal window
sha256sum ~/b15-workflow.tar.gz
tar -tf ~/b15-workflow.tar.gz
rm ~/b15-workflow.tar.gz
test ! -e ~/b15-workflow.tar.gz && printf 'Remote reset complete\n'
exit
Verify: project workflow
learner@rootvolt:~/lab/b15-workflow$ 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 ~/b15-workflow.tar.gz75d43560a9c0dc21899e880384d179f5e4b976880835963967077247aadde86c  /home/learner/b15-workflow.tar.gzlearner@labserver:~$ tar -tf ~/b15-workflow.tar.gzreport/
report/results/
report/results/errors.txt
report/inbox/
report/inbox/events.loglearner@labserver:~$ rm ~/b15-workflow.tar.gzlearner@labserver:~$ test ! -e ~/b15-workflow.tar.gz && printf 'Remote reset complete\n'Remote reset completelearner@labserver:~$ exitlogout
Connection to labserver closed.learner@rootvolt:~/lab/b15-workflow$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. REMOTE verification compares the archive digest and members, then removes the upload before returning to the local shell.
Steps (20)
  1. Type ssh learner@labserver
  2. Press Enter — Open a remote shell on the already verified host
  3. Output: learner@labserver's password:
  4. Type the password (the terminal shows nothing)
  5. Press Enter — Authenticate again to reach the remote shell
  6. 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.
  7. Type sha256sum ~/b15-workflow.tar.gz
  8. Press Enter — Compare the complete remote digest with the local digest
  9. Output: 75d43560a9c0dc21899e880384d179f5e4b976880835963967077247aadde86c /home/learner/b15-workflow.tar.gz
  10. Type tar -tf ~/b15-workflow.tar.gz
  11. Press Enter — Verify the remote archive has the intended members
  12. Output: report/ report/results/ report/results/errors.txt report/inbox/ report/inbox/events.log
  13. Type rm ~/b15-workflow.tar.gz
  14. Press Enter — Remove the uploaded archive on the server
  15. Type test ! -e ~/b15-workflow.tar.gz && printf 'Remote reset complete\n'
  16. Press Enter — Confirm the remote upload is absent
  17. Output: Remote reset complete
  18. Type exit
  19. Press Enter — Leave the remote shell before cleaning local files
  20. Output: logout Connection to labserver closed.

No. Inspect the member list and compare the complete remote digest with the local package-stage digest. The matching values establish that the checked local archive arrived unchanged. The member list checks the intended names; neither check alone proves the source text was correct.

The wide checksum rows carry the same complete digest:

Archive location Captured SHA-256 digest
Local report.tar.gz 75d43560a9c0dc21899e880384d179f5e4b976880835963967077247aadde86c
Remote b15-workflow.tar.gz 75d43560a9c0dc21899e880384d179f5e4b976880835963967077247aadde86c

Your archive digest will differ because tar records your files and their metadata. The local and remote values for your own transfer must match.

The preceding replay removes the server copy. After exit returns to the local shell, remove only this exercise’s local files and the saved labserver host keys:

Terminal window
rm report/inbox/events.log report/results/errors.txt
rmdir report/inbox report/results report
rm report.tar.gz
cd ~/lab
rmdir ~/lab/b15-workflow
ls -a ~/.ssh
ssh-keygen -R labserver
ssh-keygen -F labserver || printf 'No saved key for labserver\n'
test ! -e ~/lab/b15-workflow && printf 'Local reset complete\n'
Reset local exercise files and trust in labserver
learner@rootvolt:~/lab/b15-workflow$ rm report/inbox/events.log report/results/errors.txtlearner@rootvolt:~/lab/b15-workflow$ rmdir report/inbox report/results reportlearner@rootvolt:~/lab/b15-workflow$ rm report.tar.gzlearner@rootvolt:~/lab/b15-workflow$ cd ~/lablearner@rootvolt:~/lab$ rmdir ~/lab/b15-workflowlearner@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/b15-workflow && printf 'Local reset complete\n'Local reset completelearner@rootvolt:~/lab$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. LOCAL reset removes the source, result, archive, workspace, and only labserver's saved host keys.
Steps (22)
  1. Type rm report/inbox/events.log report/results/errors.txt
  2. Press Enter — Remove only the disposable source and derived result
  3. Type rmdir report/inbox report/results report
  4. Press Enter — Remove the empty local project directories
  5. Type rm report.tar.gz
  6. Press Enter — Remove the local transfer archive
  7. Type cd ~/lab
  8. Press Enter — Return to the baseline directory
  9. Type rmdir ~/lab/b15-workflow
  10. Press Enter — Remove the empty workspace
  11. Type ls -a ~/.ssh
  12. Press Enter — Inspect the SSH directory before removing the labserver entry
  13. Output: . .. known_hosts known_hosts.old
  14. Type ssh-keygen -R labserver
  15. Press Enter — Remove only saved host keys for labserver
  16. 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
  17. Type ssh-keygen -F labserver || printf 'No saved key for labserver\n'
  18. Press Enter — Confirm no saved key for labserver remains
  19. Output: No saved key for labserver
  20. Type test ! -e ~/lab/b15-workflow && printf 'Local reset complete\n'
  21. Press Enter — Confirm the local exercise reset is complete
  22. Output: Local reset complete

The workspace absence test checks local project cleanup; the preceding lookup confirms removal of labserver’s saved keys. Leave the SSH directory and backup in place, as described in the SSH reset explanation.

Packaging before saving the result. An archive captures files as they are when tar reads them. Saving a result afterward does not update that archive.

Checking the local pathname at the remote prompt. The same username does not mean the same filesystem. Read the host name in the shell prompt before verification or cleanup.

Goal: Explain the smallest set of stages you must repeat if errors.txt was incomplete when the archive was created.

Hint

The uploaded archive contains the earlier saved bytes.

Solution

Correct and read the saved result, package again, inspect and hash that archive, then transfer and verify that exact copy. Checking the old remote archive again cannot include edits made after it was built. Keep the source log for tracing the correction.

  • Organize inputs and results before searching and saving.
  • Inspect and hash the archive you intend to send.
  • Verify server identity before entering the account password.
  • Check the remote copy and reset both machines separately.

Next, Practice: Archives and Everyday Workflow tests a maintenance handoff and archive recovery.