Troubleshooting

Why is my SSH key not accepted?

Fix an SSH key that the server refuses in Wardterm: add the public key to authorized_keys, check its permissions and the user, then read the log.

What you see

The app shows The server did not accept the key. The details say:

authentication failed for deploy@203.0.113.10

When the key itself cannot be used, the details start with key not valid:. In the Connection log the attempt shows as Failed, wrong password or key.

Why it happens

The server accepts a key only when its public half is in the ~/.ssh/authorized_keys file of the user you sign in as, and only when that file and its folder are not writable by others.

What to do

  1. Check the User of the server: the key must be in the authorized_keys of that user.
  2. Put the key on the server with Add to a server in Keys. The app signs in once with the password and adds the public key. See SSH keys.
  3. Or add it by hand: copy the public key in Keys, then on the server:
    mkdir -p ~/.ssh
    echo 'ssh-ed25519 AAAA... you@example' >> ~/.ssh/authorized_keys
  4. Fix the permissions, which the server checks:
    chmod 700 ~/.ssh
    chmod 600 ~/.ssh/authorized_keys
  5. A key kept only on one device signs only there. On another device, use another key or add this device's key too. See Keys on this device.
  6. Read the server's log, which says why it refused, for example bad ownership or modes:
    sudo journalctl -u ssh -u sshd -n 50

The same test with OpenSSH, which lists each key it offers:

ssh -v -i ~/.ssh/id_ed25519 deploy@203.0.113.10