Get your free beta license ↗
FTP, SFTP and SSH · OpenSSH

The remote backup copy fails with “Permission denied (publickey)”

Last updated 30 Nov 2026
Summary

Copying backups to a remote server fails with Permission denied (publickey). Add UrbeStack's missing public key to the remote user's ~/.ssh/authorized_keys to fix the OpenSSH login.

Symptoms

The remote backup test fails.

urbestack-backup-remote-test
Output
{"error":"The remote did not answer as expected: backup@203.0.113.20: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). The remote refused the panel's key: put the public key shown on the Backups page in ~/.ssh/authorized_keys of backup on 203.0.113.20.","ok":false,"status":502}

Cause

UrbeStack logs in to the remote server over OpenSSH with its own key pair, which it creates once. The remote user's ~/.ssh/authorized_keys must contain that pair's public key.

Resolution

  1. Show UrbeStack's public key and its fingerprint.

    urbestack-backup-remote-key
  2. On the remote server, add the public_key line to the remote user's ~/.ssh/authorized_keys. Set the file mode to 0600 and the mode of ~/.ssh to 0700.

  3. Run the test again.

    urbestack-backup-remote-test
  4. The test returns "ok":true and the free space at the remote path. It also records the remote server's host key for subsequent nightly copies.