Raspberry Pi 4 Setup
source link: https://legends2k.github.io/note/rpi4_setup/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Raspberry Pi 4 Setup
Access via SSH (Headless)
Published Feb 9, 2021 by Sundaram Ramaswamy Updated Feb 9, 2021
I neither have a micro HDMI adapter nor a dedicated display for the Pi. I just want to use it as a server. Thanks to Raspbian for providing a simple way to auto-enable SSH on boot!
I prefer the leaner, manual approach over NOOBS, the more popular option.
dd
Raspbian’s image on to a new SD card- To auto-start SSH service on boot
touch ssh
in/boot
partition - Insert SD card, connect ethernet cable (RJ-45) and boot
- Check IP address assigned to RPi from your router’s portal
ssh -l pi IP
- Change default password (
raspberry
) withpasswd
sudo apt update
sudo apt upgrade
- Change default password (
- Use
raspi-config
and setup- Locale
- Wi-Fi country code
- Needed to abide by your country’s wireless laws
- Radio device may not work properly if not done
- Wi-Fi (SSID and password)
- Enable SSH (for good measure)
- Check
systemctl is-enabled sshd
- Make sure wireless isn’t soft-blocked:
rfkill list
andrfkill unblock wifi
- Unplug ethernet and wireless should work now
- Use
ifconfig
to know your Mac address eth0
/wlan0
interfaces that’re up have inet (IP address) populated
- Use
- Use
raspi-config
and enable VNC- Setup VNC password:
sudo vncpasswd -service
- Boot into Desktop instead of Console in System Options -> Boot / Auto Login
- See this if you want to boot to CLI and
startx
later [3]
- See this if you want to boot to CLI and
- Make sure to select a resolution under Display Options -> Resolution
- For macOS Screen Sharing to work, make
/etc/vnc/config.d/common.custom
withAuthentication=VncAuth
sudo reboot -n
- Check VNC server status:
systemctl status vncserver-x11-serviced
- You should be able to VNC to your Pi by first giving the VNC password and then
pi
’s password
- Setup VNC password:
- Install Firefox:
sudo apt install firefox-esr
sudo update-alternatives --config x-www-browser
Another interesting alternative to Raspbian is DietPi (also Debian based), comes with a bunch of software optimized for the Pi.
References
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK