Skip to content

Instantly share code, notes, and snippets.

@donrestarone
Last active January 18, 2025 17:11
Show Gist options
  • Save donrestarone/cba6c909baadb19065b2c959913701a4 to your computer and use it in GitHub Desktop.
Save donrestarone/cba6c909baadb19065b2c959913701a4 to your computer and use it in GitHub Desktop.
ssh into raspberry pi on local network (when you dont know the IP of the pi)
## METHOD 1 - using nmap
# get local ip
ifconfig |grep inet
# scan for devices on local network
sudo nmap -sP 192.xxx.y.zz/24
# when pi ip is shown connect with the user name
ssh [email protected]
## METHOD 2 - using arp
arp -a
# raspberrypi (192.168.2.30) at macaddr on en0 ifscope [ethernet]
## METHOD 3 - using hostname
ping raspberrypi.local
PING raspberrypi.local (192.168.2.30): 56 data bytes
#64 bytes from 192.168.2.30: icmp_seq=0 ttl=64 time=10.558 ms
#64 bytes from 192.168.2.30: icmp_seq=1 ttl=64 time=9.997 ms
# 64 bytes from 192.168.2.30: icmp_seq=2 ttl=64 time=6.711 ms
# 64 bytes from 192.168.2.30: icmp_seq=3 ttl=64 time=7.209 ms
# ^C
# --- raspberrypi.local ping statistics ---
# 4 packets transmitted, 4 packets received, 0.0% packet loss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment