How-to
Connect to your server from another computer
SSH (secure shell) lets you run commands on your server from your own computer, as if you were sitting at it. You need it for a server with no screen, such as a Raspberry Pi. At the end, your terminal is connected to the server and every command you enter runs there.
Before you begin
- The server is powered on and connected to your home network.
- SSH is activated for it. On a Raspberry Pi you did this in Prepare a Raspberry Pi.
- You know the server's name (hostname) or address, and the user name and password you chose.
Steps
- Open a terminal on your own computer. On Windows 10 or 11, open Terminal or PowerShell from the Start menu. On a Mac, open Terminal from Applications, Utilities. On Linux, read Open a terminal.
- Enter this command, with your user name and the server's name in place of
samandstarboard-pi, then press Enter:
ssh sam@starboard-pi.local
- The first time, SSH asks whether you trust this computer and shows a long code. Enter
yesand press Enter. - Enter the server's password and press Enter. Nothing appears while you type: that is normal.
You are connected when the terminal shows the server's name before the cursor, such as
sam@starboard-pi:~ $.
To disconnect, enter exit and press Enter. To connect again, repeat steps 1, 2 and 4.
If it does not work
- "Could not resolve hostname": your computer cannot find the server by name. Use its address instead,
for example
ssh sam@192.168.1.20. Your router's settings page lists each device and its address. - "Connection refused" or it waits and gives up: the server is still starting, or SSH is not activated. Wait a few minutes and try again.
- "Permission denied": the user name or password is wrong. Check them, including capital letters.
Find out more
This page on GitHub, where the help is written.