Remote access of a Raspberry Pi: Terminal
If you don’t have a monitor, mouse, or keyboard readily available for your Raspberry Pi setup, you can easily manage your device remotely from your Mac or PC. This method is efficient and convenient, particularly for headless setups.
Prerequisites
Pre-configured WiFi Credentials: Ensure that your Raspberry Pi's WiFi is configured with the necessary credentials during the creation of the bootable microSD card.
Bootable MicroSD Card: Insert the microSD card with a pre-installed operating system into your Raspberry Pi.
Power Supply: Connect your Raspberry Pi to a power source and turn it on.
Network Configuration: Make sure that both your Raspberry Pi and your Mac or PC are connected to the same WiFi network. This network should be the one you configured during the initial setup of your Raspberry Pi.
Accessing the Raspberry Pi using SSH
Open the Terminal or command prompt
For Mac, you can do this by pressing command + space bar > type "Terminal" > click the Terminal icon.
For windows, you can do this by pressing the Windows Key > type cmd > click the Command Prompt icon that appears.
- Type the command ssh <username>@<hostname>.local in your terminal and press return/Enter. Here, replace <username> and <hostname> .local with the username and hostname you provided in the raspberry pi imager. For this illustration, "myrpi" is used as the hostname and rpiuser is used as the username.

Type yes and press return/Enter to proceed connecting when prompted. This may occur only for the first time you're trying to connect to the raspberry pi.


Note: The text you type for the password will not be displayed.
Once you've successfully logged into your Raspberry Pi using SSH, you'll notice a change in the command prompt. This indicates that you are now operating directly on your Raspberry Pi. For example, after logging in, the prompt will display as rpiuser@myrpi (<username>@<hostname>), confirming that you are connected as the rpiuser user on the myrpi system.
With this SSH connection, you can fully access and control your Raspberry Pi's terminal directly from your Mac or Pc. This remote access allows you to execute commands and manage files as if you were working directly on the Raspberry Pi itself. You can connect the DHT22 sensor to the raspberry pi and proceed with onboarding your raspberry pi from the terminal of your Mac/Pc.
If you are not comfortable with controlling the terminal of your Mac/Pc, and you access the GUI of your raspberry pi remotely as well.