Log in with SSH
SSH is a way to log in to the command line of the station control computer over the network. You don’t need it to use Web Radio Control. It is for advanced users who want to look after the operating system of the computer, read its files, or recover the station by hand.
On the Raspberry Pi image, you log in as the Linux user wrchost, which may run commands as root with sudo.
Whoever logs in as wrchost has the whole computer, so keep its password and keys safe.
The settings are in Settings › Station › Firewall & SSH, under SSH, for the administrator alone.
Where SSH answers from
Answer SSH from chooses who can reach SSH:
- Local network only: devices on the network of the station and on its private network, never the internet. The Raspberry Pi image starts with this.
- Anywhere: also the internet, where your router lets SSH through.
To log in from elsewhere, the private network is the safest way. It reaches SSH as the local network does, with Local network only kept (see Use a private network). Choose Anywhere only when you need it, and log in with keys rather than a password. Never forward port 22 on your router.
The choice applies at once, by the firewall of the station. With the firewall off, the choice does nothing (see The firewall).
Log in with the password
The Linux user wrchost has the password of the administrator admin: the password given in
Create the administrator, and each new one set later in
My settings › Profile & password.
On a desktop, open a terminal, such as Terminal on macOS or PowerShell on Windows, and type, with the network name of your station:
ssh wrchost@shack.localEvery Raspberry Pi image starts with the same default password for wrchost. While that password is unchanged, SSH
refuses password logins, as anyone who knows the image knows it. Creating the administrator sets the new password.
Password logins shows whether SSH takes the password of wrchost. Switch it off to allow keys alone. The switch
asks for your password again, and applies at once. It can’t be turned on while wrchost has the default password. Keys
work whether it is on or off. The setup page can turn password logins on or off too.
Log in with a key
A key is safer than a password, and works whatever Password logins says.
Make a key
If you have no SSH key yet, make one on your desktop:
ssh-keygen -t ed25519Copy it to the station
Log in once with the password, and add your public key to ~/.ssh/authorized_keys of wrchost:
ssh-copy-id wrchost@shack.localLog in
ssh wrchost@shack.local now logs in with the key.
Keys says how many keys wrchost has, such as The Linux user wrchost has 1 SSH key. Keys are added over SSH, in
~/.ssh/authorized_keys., and lists them under it, each by its type and the start and end of its fingerprint. The
page never shows a key itself. You add and remove keys over SSH, in that file.
ssh wrchost@shack.local logs in without asking for the password, and Keys lists your key.Addresses blocked after failed logins
SSH slows down anyone who guesses passwords. A login gets 3 tries and 30 seconds. An address is blocked after repeated failed logins, and each new block of the same address lasts longer. An IPv6 address is blocked with its whole network.
Blocked after failed logins lists the addresses blocked now, each with its Address, Since when, and its Failed logins, or No address is blocked now.
If you are blocked yourself, wait a few minutes and try again, from the right username and password or key.
On the station control computer
For those who manage the computer over SSH:
sudo sshd -T | grep -Ei 'maxauthtries|logingracetime|permitrootlogin|passwordauthentication'shows the limits in effect. Nobody can log in asroot.sudo journalctl -u sshguardlists the addresses blocked. To never block an address of your own, such as the computer you manage the station from, add it to/etc/sshguard/whitelist, one address or network to a line, and runsudo systemctl restart sshguard.- Each change Web Radio Control makes to the SSH configuration is checked before SSH reloads it, so a change can’t take SSH away.
If something went wrong
- SSH refuses the password.
wrchoststill has the default password, as the administrator isn’t created yet or the password was reset, or Password logins is off. Use a key, or create the administrator. - SSH doesn’t answer from outside your network. Answer SSH from is Local network only. Use the private network instead.
- SSH doesn’t answer at all. Wait a few minutes in case your address is blocked. Check that you use the network name or address of the station, and that the firewall lets SSH in from where you are.
- The SSH section says the station control computer has not reported its SSH yet. Web Radio Control is not connected to the WRC host service. Restart Web Radio Control, or reboot the station.