Skip to content

Instantly share code, notes, and snippets.

@macbre
Last active March 3, 2023 12:47
Show Gist options
  • Save macbre/85afd5c9240b34b3a76cc3bc67629b7e to your computer and use it in GitHub Desktop.
Save macbre/85afd5c9240b34b3a76cc3bc67629b7e to your computer and use it in GitHub Desktop.
Raspberry PI

First steps

Enable SSH on a headless Raspberry Pi (add file to SD card on another machine)

For headless setup, SSH can be enabled by placing a file named ssh, without any extension, onto the boot partition of the SD card from another computer. When the Pi boots, it looks for the ssh file. If it is found, SSH is enabled and the file is deleted. The content of the file does not matter; it could contain text, or nothing at all.

Default credentials

username: pi 
password: raspberry

Find all devices on LAN

nmap -sn 192.168.0.0/24 -oG -
# Nmap 7.40 scan initiated Fri Mar  3 12:45:21 2023 as: nmap -sn -oG - 192.168.0.0/24
Host: 192.168.0.1 (arrisatom)	Status: Up
Host: 192.168.0.77 (Users-Air)	Status: Up
Host: 192.168.0.87 ()	Status: Up
Host: 192.168.0.95 ()	Status: Up
Host: 192.168.0.96 (myHivehub)	Status: Up
Host: 192.168.0.105 (Ajax-001744E0)	Status: Up
Host: 192.168.0.107 (raspberrypi)	Status: Up
Host: 192.168.0.154 (TL-WPA4220)	Status: Up
Host: 192.168.0.241 (macbre-book)	Status: Up
# Nmap done at Fri Mar  3 12:45:25 2023 -- 256 IP addresses (9 hosts up) scanned in 3.17 seconds
$ nmap -p80 192.168.0.0/24 -oG -
# Nmap 7.40 scan initiated Fri Mar  3 12:45:31 2023 as: nmap -p80 -oG - 192.168.0.0/24
Host: 192.168.0.1 (arrisatom)	Status: Up
Host: 192.168.0.1 (arrisatom)	Ports: 80/open/tcp//http///
Host: 192.168.0.77 (Users-Air)	Status: Up
Host: 192.168.0.77 (Users-Air)	Ports: 80/closed/tcp//http///
Host: 192.168.0.87 ()	Status: Up
Host: 192.168.0.87 ()	Ports: 80/closed/tcp//http///
Host: 192.168.0.95 ()	Status: Up
Host: 192.168.0.95 ()	Ports: 80/closed/tcp//http///
Host: 192.168.0.96 (myHivehub)	Status: Up
Host: 192.168.0.96 (myHivehub)	Ports: 80/closed/tcp//http///
Host: 192.168.0.105 (Ajax-001744E0)	Status: Up
Host: 192.168.0.105 (Ajax-001744E0)	Ports: 80/closed/tcp//http///
Host: 192.168.0.107 (raspberrypi)	Status: Up
Host: 192.168.0.107 (raspberrypi)	Ports: 80/open/tcp//http///
Host: 192.168.0.154 (TL-WPA4220)	Status: Up
Host: 192.168.0.154 (TL-WPA4220)	Ports: 80/open/tcp//http///
Host: 192.168.0.241 (macbre-book)	Status: Up
Host: 192.168.0.241 (macbre-book)	Ports: 80/open/tcp//http///
# Nmap done at Fri Mar  3 12:45:34 2023 -- 256 IP addresses (9 hosts up) scanned in 4.38 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment