Raspberry Pi #
Fresh Install #
Install
raspberry-pi-imager
on macOS.Plug in a microSD card, and flash Raspberry Pi OS.
Add a file called
ssh
(no extension, no contents) to the top folder.Add a file called
wpa_supplicant.conf
with:ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 country=DE network={ ssid="wifi-name" psk="password" key_mgmt=WPA-PSK }
Plug the microSD to Raspberry Pi, connect to power cable.
Run ssh to the Pi with
ssh pi@192.168.0.105
(the IP address may differ).- The initial password is
raspberry
. - The pre-install text editor is
nano
.
- The initial password is
When connected to a screen, Pi will prompt to upgrade stuff. Don’t do it (press skip
).
Use VNC Environment for Remote Desktop #
Reference: How to Use IOS Devices As a Monitor of Raspberry Pi : 6 Steps (with Pictures) - Instructables
- SSH to the Pi.
- Run
$ sudo apt-get install tightvncserver
- Run
$ tightvncserver
- Note down the port (
1
for example) - On a machine with screen, connect to the server (
192.168.0.105:1
for example)
For auto-start at booting, add the following to $ nano ~/.bashrc
if [ -x "$(command -v tightvncserver)" ]; then tightvncserver; fi
Do the stuff from iPad:
- iOS SSH client: Termius - SSH client on the App Store
- iOS VNC client is VNC Viewer - Remote Desktop on the App Store
How To… #
See OS info:
$ cat /etc/os-release
Reboot:
$ sudo reboot
Shutdown:
$ sudo halt
See list of running processes by uptime:
$ ps -aux --sort -time
SSH without a password:
$ ssh-copy-id pi@192.168.0.105 # Number of key(s) added: 1 # Now try logging into the machine, with: "ssh 'pi@192.168.0.105'" # and check to make sure that only the key(s) you wanted were added. $ ssh pi@192.168.0.105
Troubleshooting #
reason is APT is installing or removing packages
#
Try in sequence:
$ sudo apt-get clean
# if that returned error
$ sudo killall apt-get
$ sudo rm /var/lib/apt/lists/lock
$ sudo rm /var/cache/apt/archives/lock
$ sudo rm /var/lib/dpkg/lock
$ sudo apt-get clean
Something 2 #
$ sudo rm /var/lib/dpkg/lock
$ sudo dpkg --configure -a
Cannot SSH after re-installation #
If see this on local machine:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Try this:
$ ssh-keygen -R "<ip of server>" # 192.168.0.105, for example