I am hoping for some insights on why I can’t configure a PUSH Rsync task to a non TrueNAS machine (named Skylake) on my LAN. The server runs TrueNAS scale ElectricEel-24.10.1, and I cannot get the Rsync task set up using ‘Data Protection/Rsync Tasks’ and setting the ‘Credentials/Backup Credentials’.
I can use the System/Shell in the GUI to ssh scott@192.168.0.191 to connect to Skylake without a password after generating a public/private rsa key pair on TNS in the shell;
adding the identity to /home/truenas_admin/.ssh/Skylake (truenas_admin@truenas) with ssh-add ~/.ssh/Skylake
and then copying the public key to Skylake with ssh-copy-id -i Skylake.pub scott@192.168.0.191
This lets ssh scott@192.168.0.191 logon without a password in TNS shell.
Then
Running Rsync task, connect using from keychain gives an error scott@192.168.0.191: Permission denied (publickey,password).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(231) [sender=3.2.7]
Running Rsync task, connect using SSH private key stored in user’s home directory
Host = 192.168.0.191, SSH port = 22
Saving gives error
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 211, in call_method
result = await self.middleware.call_with_audit(message[‘method’], serviceobj, methodobj, params, self)
Then going back to Shell
ssh scott@192.168.0.191
no longer works without password
Trying to start over in ‘Backup Credentials’
SSH Connections will not delete the connection Skylake
&
‘SSH Keypairs’ will not delete Skylake Key
Thanks for the reply. Which ‘software’ are you referring to? TrueNAS is ElectricEel-24.10.1. Not sure about rsync version, will check if that’s what you mean. I have failed to configure many times using GUI Rsync task (TrueNAS middleware) and was giving up. That’s why I was exploring what was going on in the shell. I would really appreciate a screen shot of a successful Rsync SSH task from someone. Maybe I am not entering something correctly.
Thank you. I have more to work with and read. I have deleted my current Rsync task but can’t seem to delete the ‘SSH Connection’ or ‘SSH Keypair’ that I created in Backup Credentials.
Thank you again for the reply.
scott
The error I get after trying to save the Rsync Task is:
rsync_task_create.user: In order to use rsync over SSH you need a user with a private key (DSA/ECDSA/RSA) set up in home dir.
It’s not clear to me where to place the Private key or if I need to pick a different TrueNAS user.
The entries I made were:
SSH Connection and Keypairs Widgets
SSH Connections
Name Skylake
Setup Method - Manual
These authentication settings show when Setup Method is Manual.
You must copy a public encryption key from the local system
to the remote system. A manual setup allows a secure connection
without a password prompt.
Host - 192.168.0.191
Port - 22
Username - scott
Private Key - Generate New
Remote Host Key - blank
Clicked - Discover Remote Host Key
Generated Key is below at end of doc
Save button hit - Saved ok after deleting old SSH Keypair named Skylake
SSH Keypairs
Added Keypair - Skylake and Generated Private & Public Key
Downloaded both to Skylake /home/scott/.ssh
copied public key and gave new name Skylake.pub
RsyncTask - add
Path - /mnt/Tank/Shares/Sync
User - truenas_admin
Direction - PUSH
Description - SkylakePush
Schedule - Monthly
Enabled - cleared (to be unchecked)
Rsync Mode - SSH
Remote Host - scott@192.168.0.191
Remote Path - /home/scott/SSHOnSkylake
Checked - Validate Remote Path
Save gives error rsync_task_create.user: In order to use rsync over SSH you need a user with a private key (DSA/ECDSA/RSA) set up in home dir.
Thanks for the reference to the documentation pages.
scott
(Required) If Rsync Mode is set to SSH , select the connection method from the dropdown list. Options are:
SSH private key stored in user’s home directory - If selected, the user entered in User must have an SSH private key added and stored in the home directory for the user. Create the SSH connection and keypair, download the keys, then add the private key to the user in the UI and to the home directory either from the Shell using Linux CLI commands or while in an SSH session with the system.
SSH connection from the keychain - Requires creating an SSH connection and keypair before setting up the rsync task.
Thanks for the reply. If you mean, which Rsync Mode, I have tried both SSH & Module. Yesterday was the first time I tried using the Module mode. I created an rsyncd.conf on the remote machine but this failed with
Error: rsync: [generator] recv_generator: mkdir “/Sync” (in backup) failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.2.7]
After looking at your last response, I thought I would try and use “SSH connection from keychain” but keychain is not a recognized Shell command and keychain cannot be installed with the Shell.
Captain Morgan & Neofusion
Thanks for reading and helping. I deleted my Rsync Task, SSH Connection, SSH Keypair and did a restart. Entered things in the following order
Keypair, Connection, then task and it worked. I think trying different entries without deleting old and restarting was working against me.
THANKS!!!
scott