UnderBackup SSH and rsync: create a key and connect
Turn on SSH for your UnderBackup space: create an SSH key on Windows, macOS or Linux, add the public key in the backup panel, wait a few minutes for it to activate, then connect with ssh, scp and rsync.
On this page
SSH access lets you send backups to your UnderBackup space with rsync, scp and SFTP, which are encrypted and much faster than FTP for large or repeated backups. This guide walks you through it from start to finish, even if you have never used an SSH key before.
Why a key, not a password
For security, UnderBackup SSH accepts SSH keys only, never passwords. A key comes in two parts:
- Private key (for example
id_ed25519): stays on your computer or server. Never share it, never paste it anywhere. - Public key (the same name ending in
.pub): this is the one you paste into the backup panel. It is safe to share.
Your SSH login is locked to your own backup folder, with only file tools such as rsync, scp and SFTP available.
1. Create your SSH key
Create the key on the computer or server that will send the backups. If you already have a key you use elsewhere, you can skip to step 2.
Windows 10 and 11
Open PowerShell (right-click Start, then Terminal or Windows PowerShell) and run:
ssh-keygen -t ed25519 -C "underbackup"
Press Enter to accept the default location (C:\Users\YOU\.ssh\id_ed25519). You can set a passphrase for extra protection, or press Enter twice for none. Leave it empty if the key will be used by an automatic backup job.
macOS and Linux
Open Terminal and run:
ssh-keygen -t ed25519 -C "underbackup"
Accept the default location (~/.ssh/id_ed25519) with Enter. On a server that runs backups by itself, leave the passphrase empty.
In PuTTYgen, choose EdDSA (Ed25519), click Generate and move the mouse. Save the private key, then copy the text in the box Public key for pasting into OpenSSH authorized_keys file. That single line, starting with ssh-ed25519, is what goes into the backup panel.
2. Copy your public key
Display the public key and copy the whole line:
# macOS / Linux
cat ~/.ssh/id_ed25519.pub
# Windows PowerShell
Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub
It is one long line that looks like ssh-ed25519 AAAAC3Nza...xyz underbackup. Copy all of it, from ssh-ed25519 to the end.
If the text starts with -----BEGIN OPENSSH PRIVATE KEY-----, you opened the private key. Do not paste it anywhere. Open the file ending in .pub instead.
3. Add the key in the backup panel
- In CustomerPanel, go to Services → My Backups (or open your backup service) and click Open backup panel. You are signed in automatically.
- In the backup panel, open the SSH page.
- Under 1. Your SSH public key, paste the line you copied and click Save Key.
- Under 2. Turn access on or off, click Enable SSH Access.
The same page shows your Connection details: host, port and SSH username. You need them in step 5.
4. Wait a few minutes
After you enable SSH, the server sets up your secure login in the background. This takes a few minutes. The status on the SSH page changes from Pending to Active when it is ready. Refresh the page to check.
Saving a new key also takes a few minutes to apply. The old key stops working once the new one is active.
5. Connect and copy files
Replace USERNAME, HOST and the port with the values from Connection details on the SSH page. Your files live in /uploads/.
# test the login (type "exit" to leave)
ssh -p 22 USERNAME@HOST
# send a folder; only new or changed files are sent next time
rsync -avz -e "ssh -p 22" /path/to/folder/ USERNAME@HOST:/uploads/folder/
# copy one file
scp -P 22 backup.tar.gz USERNAME@HOST:/uploads/
# browse with SFTP
sftp -P 22 USERNAME@HOST
The first time you connect, you are asked to confirm the server's fingerprint. Type yes. In FileZilla or WinSCP, choose SFTP as the protocol and select your private key file in the login settings.
Back up a server automatically
On a Linux server, create the key as root (or the user that runs the backup) with no passphrase, add it in the panel, then schedule a nightly job with crontab -e:
# every night at 03:15: dated archive of the website + database dump
15 3 * * * D=$(date +\%F); mysqldump --single-transaction mydb | gzip > /root/db-$D.sql.gz && tar czf /root/site-$D.tar.gz /var/www/example.com && rsync -az -e "ssh -p 22" /root/db-$D.sql.gz /root/site-$D.tar.gz USERNAME@HOST:/uploads/nightly/ && rm -f /root/db-$D.sql.gz /root/site-$D.tar.gz >> /root/underbackup.log 2>&1
Dated files give you a history, so a bad night never overwrites your only copy. Delete the oldest ones from time to time (in the panel's file manager or with SFTP) so your space does not fill up. Your latest backups and usage also appear in CustomerPanel under My Backups, and we email you if your space gets close to full.
Troubleshooting
| Message | What to do |
|---|---|
Permission denied (publickey) | The status may still be Pending: wait a few minutes. Check that you pasted the .pub line of the key you are using. If the key is not in the default place, add -i /path/to/key to ssh, or -e "ssh -p 22 -i /path/to/key" to rsync. |
Connection refused or timeout | Check the host and port on the SSH page. A firewall on your side may block outgoing SSH. |
Host key verification failed | Your computer remembers an old fingerprint for this host. Run ssh-keygen -R HOST, then connect again and type yes. |
| Asked for a password | The key was not offered. Point to it with -i as above, and check that the private key file is readable only by you (chmod 600 ~/.ssh/id_ed25519). |
FAQ
Related: Get started with UnderBackup | SSH key authentication | Backup best practices
Need reliable backups?
Protect websites, servers, and projects with UnderHost backup services and off-server recovery options.





















