Setting up ssh with a subdomain for a raspberry pi
I’m slowly working towards setting up a raspberry pi as a web server. Before I can do that though, I have to get ssh working on the pi. Here are the steps I took to get it working! Note, I am using Raspberry Pi 4.
Using the raspberry pi GUI
- Menu > Preferences > Raspberry Pi Configuration > Interfaces Tab > Switch SSH to Enable
- Restart Raspberry Pi
- Menu > Preferences > Raspberry Pi Configuration > System Tab > Change Password from the default
raspberry
password. It won’t let you ssh in otherwise. The default user ispi
. - Open the terminal on the pi and use the
ifconfig
command to get the IP address of the pi.
From a different computer
From a different machine, open the terminal and ssh in using ssh pi@<ip_address>
. When prompted, enter the updated password. It should work!
From Google Domains GUI
Using google domains, create A NAME dns record with the subdomain of pi
(or whatever you want) and the IP address of your raspberry pi. I set the TTL to 5m, DNS stuff always seams to update pretty fast for me these days (I’m doing pretty simple stuff usually). You should now be able to ssh in using something like ssh pi@pi.<domain>.com
.