Start with the agent
A silent agent is more common than a missing key, and it is a different fault. If the panel says the agent is not reporting in, that may be the whole problem. The unit isshipways-agent, and its configuration — including the token it
authenticates with — is /etc/shipways/agent.env.
systemctl restart shipways-agent. One that starts and then fails to
authenticate is a token problem, not a key problem, and reconnecting the server
is the fix.
The key, and the two files it belongs in
Every server gets its own key from Shipways. It opens that one machine, so the one on the Network tab is safe to read out over the phone to whoever is at the console — it is not a key to your fleet.Shipways’ own key is never shown in the server’s
SSH keys list and is never offered for removal, because
removing it is exactly this situation.
~/.ssh/authorized_keys is written by Shipways and
rewritten every time the key set changes. It repairs itself, as long as
something can still get in.
Root’s /root/.ssh/authorized_keys is written once, when the machine is
connected, and never touched again. That makes it the copy that quietly goes
missing — to a provider image, a configuration management tool, or a colleague
tidying up — and its absence tends to be discovered on the day it was the last
way in.
Putting it back
1
Open a console on the machine
Your provider’s web console, or SSH from another machine that can still
sign in.
2
Copy the command from the Network tab
It appends the key to both files if it is absent, fixes the directory and
file modes, and restarts the agent. It is safe to run on a machine that is
fine — nothing is duplicated and nothing is overwritten.
3
Run it as root
Not as the deploy user. Root’s copy of the file is half the point.
4
Watch the server go online
The agent reports in within a minute or so and the panel follows by itself.
authorized_keys without a
trailing one, and a key joined onto the end of the previous line is a key that
silently does nothing.