Skip to content

Instantly share code, notes, and snippets.

@LogCreative
Last active December 5, 2022 14:07
Show Gist options
  • Select an option

  • Save LogCreative/3b6af209d3fd6309cdfac02ed98f8789 to your computer and use it in GitHub Desktop.

Select an option

Save LogCreative/3b6af209d3fd6309cdfac02ed98f8789 to your computer and use it in GitHub Desktop.
Connect to Raspberry Pi through WiFi only.
  1. Use Raspberry Pi Imager to install the Raspberry Pi OS (maybe 64-bit version). Change the setting before burning:
  • Use password to login with a new user. You have to setup a new user in the newer version of Raspberry Pi OS. Otherwise, SSH will refuse to connect.
  • Setup WiFi connection: SSID, password and region (e.g. 'CN'). Warning, use 2.4GHz band instead of 5GHz band for the most of the time.
  • Open SSH. This is closed by default.
  • Set the hostname. raspberrypi.local by default.
  1. In a computer that connects to the same router, use command ping [hostname] (e.g. ping raspberrypi.local) to get the IP address of the Raspberry Pi.
  2. Connect to the Raspberry Pi by SSH.
  • Use command ssh [username]@[IP].
  • Add new host to the local computer. Sometimes, you reinstall the OS on the Raspberry Pi, the key validation might get broken. In this scenario, you should delete the previous known host first in your ~/.ssh/known_hosts.
  • Enter the password and done.
  1. Connect to the Raspberry Pi by VNC.
  • Through SSH, use command sudo raspi-config. Enter the sub menu of Interaction Setting and turn on the VNC connection. Finish the configuration when it is ready by Ctrl+F.
  • Install VNC Viewer in your local machine.
  • Connect the Raspberry Pi by its [IP] address. Be aware of changing display resolution to a lower level due to performance limitation.
  1. Connect to the Raspberry Pi by Windows mstsc. This is not recommended since the performance is not so great. Just use command in the remote device sudo apt-get install xrdp.
  2. Connect to the Raspberry Pi by Visual Studio Code. Install the plugin Remote - SSH in VS Code and it is almost the same as connecting via SSH in the following steps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment