If you are ssh-ing into your Raspberry Pi, it can be a real pain to find and remember the IP address for the machine. This shortcut makes it easy, because you no longer need to remember!
On the computer you use to ssh into the pi, use:
nano ~/.ssh/config to open the config file in your ssh directory. (If you don’t have one of these use
touch ~/.ssh/config to create one, and then use
nano to edit it.)
Use the following:
Host myPi2 Hostname 192.168.2.45 User pi
You can use either the hostname of the Pi or the IP address for the hostname (use:
hostname in the terminal of your Pi to find the hostname or PiFinder to find the IP address).
You’ll use whatever username you usually use to log in for
You can swap
myPi2 with whatever shortcut you’d like to use to ssh in. For the above example, I would use:
ssh myPi2 to gain access to the pi, and I would then be prompted for my password.