Replication from Truenas Scale to my old Qnap NAS

corin.corvus

Dabbler
Joined
Oct 21, 2022
Messages
23
Hi,

at the moment i try to build a backup replication between my Truenas Scale Server and my old Qnap 4bay T431.

So i create backup credentials with a SSH Keypair, generate the Keypair on the Truenas and downloaded it. This are txt files. On my Qnap NAS i can import TLS Certificates, but the certificate is not supported. i tried txt and pem. So i login in the shell of qnap and add the file authorized_keys in /etc/config/ssh folder and to be save in the .ssh folder of the admin user i use to login and want to use for replication, add the Public Key and restart the system. It dont work.

I already tried the other way with a shell created keypair on the qnap nas, but it wont work.
Every time i get an authentication failure.
I only can connect via password over shell on truenas to the qnap nas.

Did anyone solve similar like this?

Thanks

Sources:
Qnap Tutorial: https://wiki.qnap.com/wiki/SSH:_How_To_Set_Up_Authorized_Keys
Truenas Tutorial: https://www.truenas.com/docs//core/uireference/system/sshkeypairs/
 

SnoppyFloppy

Explorer
Joined
Jun 17, 2021
Messages
77
Have you created a specific user on the Qnap host for this task and if so, have you added that user to AllowUsers in /etc/ssh/sshd_config?

Also, what cipher are you using when creating key pairs on the Truenas host? I would assume that the key you need to copy would be in the format id_<cipher>.pub, eg. id_ed25519.pub.

Before you try to get key based connection to work between Truenas and Qnap, try to establish a connection to Qnap from your pc:
1) On your PC, create a key pair
2) on Qnap, create a user and add it to AllowUsers in /etc/ssh/sshd_config (if not already done)
3) Copy the public key to from the PC to Qnap using ssh-copy-id username@remote_host
4) Try to establish a connection with the key by ssh -i ~/.ssh/id_XXXXXXX username@remote_host

If that succeeds you should be ready to try to connect Truenas to Qnap.
 
Last edited:

corin.corvus

Dabbler
Joined
Oct 21, 2022
Messages
23
Is key-based authorization enabled in the ssh daemon on the Qnap NAS?
Thats a good question. Where i can see it? I never see it in the tutorials.

Here are my SSH Settings:
1668164718488.png


i tried to login via ssh now, but i only get a connection refused. i try to solve this at the moment. after i want to show in sshd_config
 

SnoppyFloppy

Explorer
Joined
Jun 17, 2021
Messages
77
I don't use Qnap so I'm not familiar with the UI but if I'm correct that it's running on linux, have a look in /etc/ssh/sshd_config and look for PubkeyAuthentication. It should default to Yes
 

SnoppyFloppy

Explorer
Joined
Jun 17, 2021
Messages
77

corin.corvus

Dabbler
Joined
Oct 21, 2022
Messages
23
I don't use Qnap so I'm not familiar with the UI but if I'm correct that it's running on linux, have a look in /etc/ssh/sshd_config and look for PubkeyAuthentication. It should default to Yes
Ok after Reset my NAS i can go in SSH again.

sshd_config i see this:
#PubkeyAuthentication yes

i need to change that. Thanks for the hint.

And the next Error... "zfs: command not found".
The Qnap Nas cant ZFS.

1668427792421.png

1668427801824.png


How i can backup my Data? :confused:
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Not with a replication task...

What you can use (since both systems have it) is rsync...
 

corin.corvus

Dabbler
Joined
Oct 21, 2022
Messages
23
Not with a replication task...

What you can use (since both systems have it) is rsync...
For rsync i need to mount the qnap shares on the truenas. The Qnap work with a timeplan. Only one day of a week the Nas comes online.
Can i use rsync with remote shares without mounting on cli?
Can i rsync with versioning or 2-n backup states in different folders?
i never use rsync for more than simple syncs.
 

sammael

Explorer
Joined
May 15, 2017
Messages
76
Hi sorry for necroing this post, but I am trying to achieve the same, I got the ssh connection up, truenas can list the directories from qnap, but I've no idea which of the generic names there is my newly created shared folder for the replication so I've no idea what to choose here, anyone can help? Thanks!
1683535629515.png

all of the zfs# folders only have subdirectory RecentlySnapshot in them

I already have rsync set up, but I wanted to compare the speed since I updated the qnap to the QuTS hero system with zfs.
 
Top