6

Raspberry Pi 4 Setup

 2 years ago
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.
neoserver,ios ssh client

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.

  1. dd Raspbian’s image on to a new SD card
  2. To auto-start SSH service on boot touch ssh in /boot partition
  3. Insert SD card, connect ethernet cable (RJ-45) and boot
    • Check IP address assigned to RPi from your router’s portal
  4. ssh -l pi IP
    • Change default password (raspberry) with passwd
    • sudo apt update
    • sudo apt upgrade
  5. 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 and rfkill unblock wifi
  6. 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
  7. Use raspi-config and enable VNC
    • Setup VNC password: sudo vncpasswd -service
    • Boot into Desktop instead of Console in System Options -> Boot / Auto Login
    • Make sure to select a resolution under Display Options -> Resolution
    • For macOS Screen Sharing to work, make /etc/vnc/config.d/common.custom with Authentication=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
  8. 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

Tagged: tech, hardware


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK