Page 1 of 1

Unable to SSH Access with key exchange

PostPosted: Fri Dec 26, 2025 6:19 pm
by sormariano
Hello
I am able to access with root username and password in my Lacie Netwprk Space 2 with last firmware 18.3.
I want to use is as a backup NAS through a shell script using rsync (another problem for a my future post)-
But I'm not able to enable the SSH Access through keys:
I always have
Code: Select all
root@lacie-nas.station: Permission denied (publickey).

How can I solve this ? I used a lot of kind of generated keys but with no success.
If you need some trace or log, please ask I'll post them.
I'm trying the ssh connection both from a Linux PC and an Asustor NAS.
Thanks

Re: Unable to SSH Access with key exchange

PostPosted: Sat Dec 27, 2025 4:53 pm
by sormariano
I will try to be more detailed.

I would like to use this command to do a backup managed by cron fro my Asustor
Code: Select all
rsync -aAXvz --delete --numeric-ids /volume1/home root@lacie-nas:/share/1000/backup_asustor

In this way I can keep the user and groups ids. If I'd use rsyncd user, all the files on the Lacie will have as owner and group rsyncd:rsyncd
I am in my home network ancd I could also use a file containing the rsyncd password, if I'm not wrong, but I prefer to use keys.
But I don't understand where is my error

Re: Unable to SSH Access with key exchange

PostPosted: Mon Dec 29, 2025 9:40 am
by Jocko
sormariano wrote:Hello
I am able to access with root username and password in my Lacie Netwprk Space 2 with last firmware 18.3.
I want to use is as a backup NAS through a shell script using rsync (another problem for a my future post)-
But I'm not able to enable the SSH Access through keys:
I always have
Code: Select all
root@lacie-nas.station: Permission denied (publickey).

How can I solve this ? I used a lot of kind of generated keys but with no success.
If you need some trace or log, please ask I'll post them.
I'm trying the ssh connection both from a Linux PC and an Asustor NAS.
Thanks

Hi

You have to enable the option "SSH Access with key exchange" from SSH server

Please to notice with this mode, you can no longer use root credentials to login as by using key exchange we assume you want to open the ssh port and it is not safe to have an access from WAN with password

Re: Unable to SSH Access with key exchange

PostPosted: Fri Jan 02, 2026 4:46 pm
by sormariano
Ok I solved but I have some questions.

I logged to the asustor with key but from client I had to do this:
Code: Select all
ssh -o PubkeyAcceptedAlgorithms=+ssh-rsa -i .ssh/id_rsa_lacie root@lacie-nas


Said this, anyway I succeeded in making a backup with rsync servar to copy file FROM my Asustor NAS (configured with rsync server with modules) TO my Lacie.
But till now I only was able to do these backups manually from GUI.
Maybe it's my fault but the GUI isn't too much user-friendly-
I'm still trying to automate (with cron) these backups with the help of a wakeonline through the administrator GUI but it's not easy

Re: Unable to SSH Access with key exchange

PostPosted: Sun Jan 04, 2026 4:53 pm
by sormariano
Ok finally I succeed in setting backups using the GUI, but I suppose there is an error. Could you check ?
I have the Selected source folder as an RSYNC module of another NAS and as "Selected destination folder" a folder in my Lacie.
Then I "Add scheduled backup in cron" and, at its execution I get the error:
Code: Select all
PHP Parse error: syntax error, unexpected '.' in /share/1000/cronjobs/Rsync_Public.on.backup_asustor_tpWsjD.php on line 21

due to the dot '.' of
Code: Select all
--password-file="/rw_fs/etc/.passwd-192.168.1.2:myuser"


The backup works fine if I replace the double quotes of the password filename with single quotes or if I remove them at all.

The whole line 21 is:
Code: Select all
$cmd = "umask 0 && /usr/sbin/rsync --stats --force --ignore-errors --modify-window=2 -tDvplogr --delete -8 --password-file="/rw_fs/etc/.passwd-192.168.1.2:myuser" --port=873 myuser@192.168.1.2::'Public' '/share/1000/backup_asustor/Public'> '/share/1000/cronjobs/Public_";


Please, note the double quotes after --password-file that I suppose are the ones sending the interpreter in panic since they cause an undesired closure of the double quote at the beginning

P.S. I think it's also missing a single quote at the last end of the $cmd build. I added it

Re: Unable to SSH Access with key exchange

PostPosted: Mon Jan 05, 2026 4:04 pm
by Jocko
Hi

Thank you for the feedback. I go to check this issue this week.

Re: Unable to SSH Access with key exchange

PostPosted: Wed Jan 14, 2026 4:36 pm
by Jocko
Hi

I checked this function and indeed there was a bug.

All was ok if you run the job from the backup menu but not if you add it as a cron job. Indeed there were some missing escape on double quote on the command line. the firmware made it but did not reuse it when it created the php script. :shocked

To test if all is ok, open a shell window and run these command
Code: Select all
plugout download 7453
 tar -xf /tmp/fvdw-sl-18-3_fix-backup-cron_14jan2026.tgz -C /


Try to do a backup cron job and see if the script runs nicely now...

if fixed I will release a patch

Re: Unable to SSH Access with key exchange

PostPosted: Sat Jan 17, 2026 11:21 am
by sormariano
Ok Jocko , it seems the bug has been fixed.
I run the generated cron command as:
/usr/bin/php '/share/1000/cronjobs/Rsync_UserHomes.on.new_backup_asustor_Vg3ZHr.php' and it was successful

Thanks

Re: Unable to SSH Access with key exchange

PostPosted: Sat Jan 17, 2026 6:23 pm
by Jocko
Thank you for the feedback. So I will release soon a patch