Unable to backup to TrueNAS

NethServer Version: 7.9.2009
Module: backup

I try to setup so I can store my backups on my TrueNAS server and I want to use an AD account to store the backups. The configuration for sftp works fine and it confirms that the configuration is OK. However when it tries to run it on schedule it fails with this error message

Fatal: create repository at sftp:NETBIOS_DOMAIN[backup_account@fqdn_of_backup_server:/mnt/pools/ds_backup/server](mailto:backup_account@fqdn_of_backup_server:/mnt/pools/ds_backup/server): failed: unable to start the sftp session, error: EOF

I have checked the account using Filezilla and I can create and delete both files and folders.

TrueNAS has a quirk that it requires the format NETBIOS_DOMAIN\account_name for accounts from an AD but Nethserver seems to add the FQDN of the backup server to the account. Do you have any suggestion how I can make it work?

SFTP backup uses public key authentication to connect without password, maybe it needs to be enabled on the NAS?

When setting up the SFTP backup, it uses ssh-copy-id to put it’s public key to ~/.ssh/authorized_keys on the NAS. If this isn’t possible for whatever reason (like no writeable home dir) the backup doesn’t work and you also get the unable to start the sftp session error.

You may try to add the key manually:

The public key is stored in /var/lib/nethserver/backup/backup.key.pub on the NethServer.

I don’t use TrueNAS but it seems to support SSH public key configuration in UI, see documentation (scroll down to authentication) so I think you just need to enter the public key for the right user to make the backup work.

1 Like