Curriculum for teaching computers.
[https://www.canakit.com/raspberry-pi-400-desktop-computer-kit.html]
[https://www.canakit.com/mini-micro-sd-usb-reader.html]
[https://www.raspberrypi.org/software/]
- Make sure the Pi is off and or unplugged.
- Eject or pull the SDCard out of the Pi and put it into the USB SDCard adapter.
- Put the USB adapter into your workstations USB port.
- Run the Raspberry Pi Imager and access the advanced options menu by typing
control+shift+X.
- Values in all caps like YOURNAME are where you put in your setting.
☑ Set hostname: YOURNAME-pi.local
☑ Enable SSH
Use password authentication
set password for 'pi' user: raspberry
☑ Configre wifi
SSID: YOURWIFINAME
Password: YOURWIFIPASSWORD
Wifi country: US
☑ Set locale settings
Times zone: YOURTIMEZONE
Keyboard layout: US
☑ Skip first-run wizard
Persistent settings
☑ Play sounds when finished
☑ Eject media when finished
☑ Enable Telemetry
- Save the Advanced options.
- Operating System
CHOOSE OS -> Use customand pick the2021-05-07-raspios-buster-arm64-lite.zipyou downloaded. - Storage
CHOOSE STORAGEpick the SDCard you inserted in your usb. Be careful here not to pick your workstation drive. - Write
- Remove the USB SDCard adapter from your workstation.
- Take the SDCard out of the adapter and put it back into the Pi.
- Turn on the Pi.
- On your workstation open a terminal or powershell.
- To get the IP address on Windows type:
Resolve-DnsName USERNAME-pi.localto get the Pi server IP address. - To get the IP address (non-windows) type:
ping USERNAME-pi.localto get the Pi server IP address.
- In your terminal/powershell type
ssh pi@IPADDRESSto log into the Pi server with the usernamepiand the passwordraspberry.
Generating a pair of SSH keys allow you to ssh login to your server without typing or remembering your password. There is a private and public key. You keep your private key secret and safe and give out your public key to any server you would like to securely connect to. SSH keys are better than passwords because passwords could be "forgotten" and they could easily be figured out.
-
Create SSH key pair on your workstation.
- Check if you already have an ssh key pair (id_ras and id_rsa.pub) on your workstation. If you do skip to step 3 to copy the key to the server. Note:
~/is a shortcut path to your home directory.ls -la ~/.ssh
- Check if you already have an ssh key pair (id_ras and id_rsa.pub) on your workstation. If you do skip to step 3 to copy the key to the server. Note:
-
Create new ssh key pair.
ssh-keygen -t ed25519 -C "your_email@example.com"- Press Enter to save the key at the default path.
- Press Enter to accept no passphrase.
- Press Enter again to confirm no passphrase.
- Your public key is now saved at
~/.ssh/id_ed25519.puband the private key is at~/.ssh/id_ed25519
-
Make the .ssh directory on your Raspberry Pi if it doesn't exist
- Enter
ssh <USERNAME>@<SERVER-IP> "mkdir -p ~/.ssh"into your terminal
- This will make the directory if it doesn't exist, the -p silences the error message if it already exists.
- Be sure to replace <USERNAME> with your username on your server and <SERVER-IP> with the IP of your server
- Enter
-
Copy your public SSH key to your server
- Linux/MacOS:
ssh-copy-id -i ~/.ssh/id_ed25519.pub <USERNAME>@<SERVER-IP> - Windows:
cat ~/.ssh/id_ed25519.pub | ssh <USERNAME>@<SERVER-IP> "cat > ~/.ssh/authorized_keys"
- Be sure to replace <USERNAME> with your username on your server and <SERVER-IP> with the IP of your server
- Linux/MacOS:
-
Log in to your server to confirm that the ssh keys are working
ssh <USERNAME>@<SERVER-IP>. You should no longer be asked for a password to connect to the pi server.
- [https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#4-boot-ubuntu-server]
- [https://ubuntu.com/server/docs/install/autoinstall-quickstart]
- [https://ubuntu.com/tutorials/install-and-configure-nginx#1-overview]
- [https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent]