Raspberry Pi setup
Migration
ISR Raspberry Pi setup
ISR Raspberry Pi setup
Your goal today is to setup a complete Raspberry Pi (rPI) computer including cloning the SD card, powering the unit, keyboard, mouse and monitor.
You might find these references handy, depending on your interest level:
https://elab.hpa.edu/isr/pdf/MasterRaspberryPi-2021.pdf
https://elab.hpa.edu/isr/pdf/getting-started-with-raspberry-pi-9781449344214.pdf
https://elab.hpa.edu/isr/pdf/official_raspberry_pi_beginners_guide.pdf
These are all in progressa directory with many, many things here:
https://elab.hpa.edu/isr/pdf/
Steps:
setup power, keyboard, mouse, video adapter, HDMI monitor (monitors are in the workshop)
clone SD card with the latest raspian operating system (an rPi version of Debian LInux, developed by a guy named Ian, married to Deborah: Deb-Ian)
there is an SD card writer on the acoustics laptop, use the Balena etcher program to clone the raspian 64 bit image
pick an rPi unit, either the 400 (red) ones or one of the rPi4 units (smaller)
startup your rPi, go through setup screens
leave network as wireless, elab2, the usual password
keep the username as pi, and the login password to papaya77
Once your Pi is setup, customize the screens, and make sure you can find the terminal app.
Enable SSH:
enable ssh using the terminal command: type sudo raspi-config in the terminal window
go to interfacing options, select ssh and enable
please also name your rPi in the hostname field with your first name
Finding your IP address, ping command:
using terminal, type sudo ifconfig, or if that does not work, sudo ip addr show
write your IP address on the board, along with your name (email this to me as well)
using terminal, type ping, then one of the other addresses on the board, record this value
using terminal, type ping 10.14.1.4, one of our elab routers, record this
now ping something outside our elab, any address will do, like www.apple.com or other
leave your rPi powered up when you leave, I'll check on your settings remotely
Navigation: (see also the references listed above)
type pwd in the terminal
this shows the "present working directory", which you can think of like looking around once you get out of an elevator, it shows you what level you are on (also known as "print working directory")
type ls, for
"list" which will show you what rooms are on this floor
to go up one directory, type cd ..
you can also type cd then the name of a directory to browse, like cd /Desktop
find the app called File Manager, open it
navigate using this app, as well as the terminal until you can use both to go up and down through directories (floors) and look around (ls command)
the terminal is what is called the "command line" and what you have been using is called the CLI or "command line interface"
CLI gives you super powers, including the ability to control other computers at a distance (great for evil folks, also for system administrators)
Secure Shell:
secure shell (ssh) is a command that lets you enter another computer, once this access is enabled (you did so above)
you are ONLY to use ssh on the rPi units in our classroom, any other use can get you booted out of HPA (yes, this has happened)
using ssh, find one of the IP addresses on the board
ASK the person running that rPi if you can ssh into their computer, don't ssh until you have confirmation this is ok
in the terminal, enter the command ssh pi@10.14.253.x where x is the last number in their address
enter your password
you are now "inside" their computer
browse around using the CLI, it should be structured like yours
try using the ping command to ping your own computer from theirs
try pinging other computers from their computer (hackers use this to cover their tracks)
a "ping flood attack" is one version of a denial of service, where you ping repeatedly, effectively disabling their computer, this is disabled in raspian by default, please do not try using this for now.
Text files: nano, more or less
using your super CLI powers, use terminal to navigate on your rPi to the Desktop
type pwd to make sure you are on the Desktop
type sudo nano test in the terminal window
a text editor will show up, type some wise words
type control-o (this is holding the control key while typing the o), save the file
ctrl-x to exit
look on your desktop, you should see a file there, if not, try again
in the command line, navigate to the Desktop again, pwd and ls to find the test file you created
type less test
the content of your file should show up
ctrl-z to exit, or ctrl-c to cancel
try also with more test
try reading the test file on another persons computer using ssh (always ask first)
now try creating a (clean) file on another computer, using ssh
ask them to read your file
Updating the rPi:
you will often be installing programs (free), and updating is part of the process
in the terminal, type sudo apt-get update -y
this should update your rPi and may take a bit of time, be patient
you can also upgrade your rPi using sudo apt-get upgrade -y
Installing programs:
install the hardinfo program using sudo apt-get install hardinfo -y
we put the -y at the end to say "yes" to any question
open the program using the terminal, type hardinfo
close the program using ctrl-c, or just close the terminal window
open the program from the applications menu (upper left) and see if it looks the same
try installing wavemon and test it out
Status commands: top, ps, who, last, history
try the following commands:
top is the top processes
ps is the process list
who tells you who is currently logged in (it should be you, if not, someone is invading)
last is the list of the last login (again, this should be you, if not, you may have been hacked)
history is a list of the commands you have entered (very handy for recording your work)
Looking things up: DNS
use the nslookup command to lookup the IP address of a host (like www.apple.com)
try asking different servers for their record using the command server 8.8.8.8 once you are in the nslookup window
type exit to escape
use this tool to diagnose broken network settings
Tracing the internet: traceroute
try the traceroute command: traceroute www.apple.com
repeat with other sites, both named and using IP addresses
Directory ninja tricks: Hidden files
go to a directory of your choice on the terminal
type ls and look at the list of files
now type ls -la and see what else shows up
any file with a . in front is invisible
you can create invisible files this way, or modify hidden files (like license files)
try again using ls -lha this is the human readable version
Migrated from Apple WikiServer Wiki. Original page M301w8m.ID: M301w8m