Logging On To Your Pi Remotely

Once your Pi is up and running, you may want to put it away in your wiring cabinet or server rack. In that case, you'll need some means of logging on to it across the LAN rather than using a local keyboard and mouse. Telnet is deprecated nowadays and SSH should be used instead. The Pi comes with SSH installed but disabled by default. On later versions of the Pi OS, you can choose to enable SSH as part of the set-up process. Alternatively, to enable SSH at a later stage you can either run the set-up process again or follow the steps below.

Step 1

At the Pi command line, enter the following command.

sudo mv /boot/boot_enable_ssh.rc /boot/boot.rc

Step 2

Now, reboot your Pi.

sudo reboot

Step 3

When the Pi has restarted, you should be able to see the message "Starting OpenBSD Secure Shell server: sshd" near the end of the startup messages. You can now manage the Pi using SSH across your LAN/WAN. However, if you have your Pi accessible from the Internet it's good practice to set up a public/private key to log in rather than a password.

If you're going to be connecting from a Windows PC, there is no native SSH available yet so you will need to install a third party SSH client. OpenSSH from SourceForge is the one I use. When you connect to a remote system, OpenSSH creates a file called known_hosts with the IP address and an SHA hash that uniquely identifies the remote host. If you refresh the operating system on your Pi, or upgrade it to a different version, SSH will complain and you will need to delete the entry for its IP in the known_hosts file and start SSH again.