Setting up Raspberry PI with SSH
Using Raspberry Pi as a "Headless Operation"
Last updated
Was this helpful?
Using Raspberry Pi as a "Headless Operation"
Last updated
Was this helpful?
To SSH into your Raspberry Pi using PowerShell, follow these steps:
Open a terminal on the device you would like to SSH into your Raspberry Pi from. In these steps, we’re using Windows PowerShell.
To open PowerShell, either press Ctrl + Shift + P, or hit the Windows key and manually search for PowerShell.
Enter the following command to secure shell in:
ssh [username]@[hostname].local
ssh [username]@[IP address]
Replacing [username] and [hostname] or [IP address] with the details of your Raspberry Pi.
The details of your Raspberry Pi were established when you set up your operating system image
This is the command to enter:
You will get asked to verify the fingerprint:
Since it’s your first time connecting to wally.local
, your computer doesn’t recognise it.
Just like when you meet someone for the first time, your computer wants to make sure it’s safe to talk to wally.local
.
Message: “ED25519 key fingerprint is SHA256:WnRSpUwvuCvCEPjEng1oOfnljIXM4KP5IP1CKS8Q0Y.”
Explanation: This is a digital fingerprint or identifier for wally.local
. Just as humans have unique fingerprints, computers that use SSH have unique keys. This fingerprint helps verify that you are connecting to the computer you think you are connecting to.
Message: “Are you sure you want to continue connecting (yes/no/[fingerprint])?”
Explanation: This is a security check. By saying “yes”, you’re telling your computer that you trust wally.local
. Once you confirm, this fingerprint will be saved on your computer, so next time you won’t see this warning for wally.local
.
First-time Connection: If you are sure that the address and the fingerprint shown are correct (you might recognise them, or have been given them by someone who manages wally.local
), type “yes” and press Enter. This will add the fingerprint to a list of trusted hosts on your computer.
Subsequent Connections: If you connect again in the future, your computer checks this list. If the fingerprint matches, it connects without the warning; if not, it will warn you again, which might indicate something is wrong (like connecting to a different computer using the same name).
This process protects you from a cybersecurity threat called “Man-in-the-Middle” attacks, where someone could impersonate wally.local
to steal information or cause harm.
By checking the fingerprint, you ensure that you are connecting directly to the real wally.local
, not an impostor.
Accepting the Host Key:
Message: "Warning: Permanently added 'wally.local' (ED25519) to the list of known hosts."
Explanation: By saying "yes," you told your SSH client that you trust the identity of the host wally.local
.
The SSH client then added the host's ED25519 public key fingerprint to your computer's list of known hosts.
This list is used in future connections to verify that you're connecting to the same host as before. The purpose of this step is to prevent "man-in-the-middle" attacks by ensuring that, in future connections, you're connecting to the same server you initially verified and trusted.
This demonstrates the connection:
The ifconfig
command output shows information about the network interfaces on a Linux machine.
Here's a breakdown of what each part of the output means for the three interfaces listed: eth0
, lo
(loopback), and wlan0
.
State: It is up, indicating it is active, but it has no IP address assigned. This suggests it's not currently connected to a network or not configured to receive an IP address.
MAC Address: The hardware address is 2c:cf:67:2c:91:19
.
Traffic: There are no transmitted or received packets, which indicates no data has been sent or received since the last reset or network interface initialization.
State: It is up and running, indicating it's active and functioning.
IP Address: The IPv4 address is 127.0.0.1
, which is the standard loopback address, allowing the system to communicate with itself.
Traffic: There are some packets transmitted and received, which is normal for the loopback interface as the system may use it for internal communication.
State: It is up and running, and it's connected to a wireless network.
IP Address: The IPv4 address is 192.168.68.64
with a subnet mask of 255.255.252.0
, and the broadcast address is 192.168.71.255
.
IPv6 Address: It has an IPv6 address fe80::62a8:8dd9:cb43:c3b1
, which is a link-local address.
MAC Address: The hardware address is 2c:cf:67:2c:91:1a
.
Traffic: There have been 1771 received packets and 1023 transmitted packets, indicating active network communication.
RX Errors and Drops: No received errors, but there are 74 dropped packets, which could be due to various factors like weak signal strength, interference, or network congestion.
TX Errors: There are no transmission errors, suggesting the outgoing traffic is functioning well.
Your eth0
interface is not currently being used for network communication, your lo
interface is working normally for internal system communications, and your wlan0
interface is actively connected to a network and communicating, although there are some dropped incoming packets that might need attention depending on the use case and network environment.
All you need to find out the IP address of your Raspberry Pi is to run the following command in the terminal.
The output:
Your hostname, or IP address for your Raspberry Pi is 192.168.68.64