SSH-CLI Remote Control of a Raspberry Pi




100 Points
Learning Objectives

SSH-Secure SHell

These instructions will show you how to use Power Shell to run the SSH protocol and software on your laptop to connect to a single-board computer(SBC).
This software allows you to run a terminal window (CLI) on a Raspberry Pi over a network using your laptop.
This 'remote access' technology has revolutionized the way IT professionals work, allowing them to access numerous devices all over the world from their computer.
More information on Secure SHell is available online.
Being able to use this software will greatly simplify working with the Raspberry Pi, Arduino UNO and micro:bit.

After completing this assignment you will be able to:

  1. Run PowerShell on a Windows computer
  2. Establish an Secure SHell (SSH) between your Windows computer and a single-board computer
  3. Issue commands to the Raspberry Pi SBC from your laptop using SSH
  4. Update/upgrade the Raspberry Pi operating system from your laptop using SSH

Assignment Overview
This assignment reviews basic computer concepts that you will need in this course and throughout your career.

You are expected to have a working knowledge of SBC hardware and software.
If you do not understand how to use an item, perform a Google Search, refer to the WSU Technology Knowledge Base,  ask a teaching assistant, or ask the instructor.

Raspberry Pi 3 layout
Figure 1-Raspberry Pi 3 B+ layout


Exercise 1-Setup the Raspberry Pi
  1. This work is done on the Raspberry Pi.
  2. Locate a USB keyboard and mouse.
    Plug them into available USB ports on the right side of the Pi.
    See Figure xx
  3. If the Pi is powered on, there is a steady red light in the lower left corner of the circuit board.
    If the Pi is not powered on, click the power button on the Pi, which should be on top or around the monitor in front of you.
    Below the red light is a green light that will flash, indicating CPU activity.
  4. In the lower right corner of the landscape monitor, press the button marked with the colored dot.
    Repeatedly pressing this button toggles the monitor between displaying your laptop and the Raspberry Pi.
  5. ONLY CONNECT TO WSU GUEST NETWORK!!!
    FOLLOW THESE INSTRUCTIONS
    When prompted make a new account, supply bogus information and log in.
    Note: periodically you will need to open the Raspberry Pi browser to 'winona.edu' or other website, and repeat the WSU Guest Network login process.
  6. In the upper right corner of the desktop click on VNC to display the Raspberry Pi IP address.
    Raspberry Pi Desktop
    Figure 2-Raspberry Pi Desktop


Exercise 2-Connect with PowerShell
  1. These steps are performed on your laptop.
  2. Your laptop MUST be connected to the WSU network with a WIRED connection, a wireless connection will NOT work.
    Look for this icon in your task tray: wired connectionWired Network Connection Icon

  3. Open Windows PowerShell by clicking Start> type 'PowerShell'
  4. At the PowerShell command line type: ssh pi@xxx.xxx.xxx.xxx replacing the xxx with the Raspberry Pi IP address retrieved above.
    When prompted for the Raspberry Pi password enter 'W1n0nA'  Refer to the figure above.
    PowerShell SSH login
    Figure 3-PowerShell Interface


Exercise 3-Working With SSH
  1. These steps are done on your laptop.
  2. There is no graphical user interface in PowerShell/SSH, you must type in all commands.
    If you need help, simply type in 'help' and press enter to see a list of available commands.
  3. Periodically, at least weekly, update your Raspberry and apply the latest program patches and security fixes by typing in the following commands, pressing Enter after each one:
    sudo apt-get update
    sudo apt-get upgrade
    You will be prompted to continue, press 'y'
    During this process read and comprehend any messages.
    Depending on how much updating is being done, it may take a while.
    If something goes wrong, there will be an explanation of how to proceed.
    See a teaching assistant or professor for help.
    RPi update
    Figure 4-Update Raspberry Pi-your messages will be different

  4. In the PowerShell-SSH window install the Matrix program
    Enter the following text, then press the enter key:
    sudo apt-get install cmatrix
  5. After cmatrix is installed, type in, then press the enter key:
    cmatrix
    You will see a matrix program running on the Raspberry Pi.
    Press the q key to quit the program, and return to PowerShell/SSH.
    Feel free to explore the available options.
    reference: http://reefwingrobotics.blogspot.com/2017/01/raspberry-pi-console-matrix-screensaver.html
  6. Type cmatrix -h and press enter to view the command line options.

  7. Type cmatrix -b -s and press enter to see the program start with bold font characters, and ???
    Cmatrix Screen Shot of PowerShell-SSH window
    Figure 5-cmatrix running, press 'q' to stop...

  8. Press the 'q' key to return to the PowerShell/SSH window.
    You are going to take a screen shot of this window for the next exercise.

Exercise 4-ScreenShot

Use the Snipping Tool on your laptop to take a screenshot of the PowerShell-SSH window running cmatrix in the previous exercise.
Your screen shot will look something like this:
Cmatrix Screen Shot of PowerShell-SSH window
Figure 6-SSH Window Sample Screen Shot

Save the screenshot as "IOTP03" in your ' ' folder.

In PowerShell type logout to close the SSH connection to the Raspberry Pi.
cmatrix
Figure 7- Close RPi Connection


ScreenShot IOTP03


Upload Screenshot

Submit to the appropriate D2L Assignment folder a screenshot that documents your work, showing cmatrix running in a PowerShell ssh session.


(70) 1. Upload your screenshot to the 'IOTP03' D2L Assignment Folder.


Exercise 5-Reflection

Based on your experience in this exercise and what you just learned, develop a brief statement about the value of SSH as a remote access tool for organizations.
Think about what type of problems these devices could solve, and would it be cost-effective?
Consider businesses that deploy IoT 'solutions', on the order of thousands or millions of devices-how can support of these devices be automated?
References:
TechTarget-Secure Shell
KeyFactor-The What, Why & How of SSH Protocol
Balena Cloud -an example of a platform for controlling, supporting, administering large numbers of IoT devices

(20) 2. Reflections



Submit Assignment

When all tasks are completed press the Submit button.


(10) 3. Assignment submission


-- WHEN DONE --
SHUTDOWN THE RASPBERRY PI
TURN OFF THE POWER