I mean using SSH, because HDMI, mouse, keyboard, and monitor will eat up the whole space in my desk.
Prepare the Raspberry Pi OS
Firstly we need to get our microSD card with bootable Raspberry Pi OS. I recommend to use Raspberry Pi Imager to make this process easier. We just need 3 steps, download the Raspberry Pi Imager then chose our preferred OS, select the SD card, then write.
Access SSH to Raspberry Pi
By default, SSH access is not allowed. After we wrote the image of Raspbian on our SD card. Create an empty file called ssh
inside the boot partition. This will enable the SSH access to your Raspberry Pi.
Raspberry Pi WIFI Auto Connect
Next, just access the Raspberry Pi using ethernet cable by using the IP address. But if we prefer to use wifi, we need to enable the auto-connect to the wifi. Still inside the boot partition, in the same folder, create a file called wpa_supplicant.conf
and write down like this:
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
scan_ssid=1
ssid="your_wifi_ssid"
psk="your_wifi_password"
}
Change the paramater wifi SSID and password to match our router and save the file.
Now each time you boot up the Raspberry Pi, using your PC in the same network, you can find your Raspberry Pi already connected to the network without any user interface needed.
Finding the Raspberry Pi IP Address
There are many ways to find the Raspberry Pi IP address if we connect the Raspberry Pi via DHCP router or local network. Usually I used arp-scan
for this. Install the arp-scan
on your host PC:
sudo apt install arp-scan
Then scan your local network by using:
sudo arp-scan -l
ibndias@shaheen:~$ sudo arp-scan -l
Interface: eno1, type: EN10MB, MAC: xx:xx:xx:xx:xx:xx, IPv4: 10.0.3.XXX
Starting arp-scan 1.9.7 with 256 hosts (https://github.com/royhills/arp-scan)
10.0.3.X xx:xx:xx:xx:xx:xx (Unknown)
10.0.3.XX xx:xx:xx:xx:xx:xx EFM Networks
10.0.3.XX xx:xx:xx:xx:xx:xx NETGEAR
10.0.3.XXX xx:xx:xx:xx:xx:xx Samsung Electronics Co.,Ltd
10.0.3.XXX xx:xx:xx:xx:xx:xx Apple, Inc.
10.0.3.176 xx:xx:xx:xx:xx:xx Raspberry Pi Trading Ltd
Here you can see that our Raspberry Pi IP is 10.0.3.176
. We can start to connect via SSH by using default account.
ssh pi@10.0.3.176
And the default password is raspberry
.
ibndias@shaheen:~$ ssh pi@10.0.3.176
Linux raspberrypi 5.4.72-v7l+ #1356 SMP Thu Oct 22 13:57:51 BST 2020 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Nov 18 09:37:57 2020
SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.
pi@raspberrypi:~ $
That’s it, now we can use our Raspberry Pi without cluttering our desk. 😉