First time poster and massive unix/linux novice here.
I have a Western Digital My Cloud NAS, which runs (I believe) some version of Debian. I've got a remote backup account with Rsync.net, and want to run daily backups using rsync from the NAS to the remote server.
I have full ssh access to the NAS. I've successfully generated the public and private keys using ssh-keygen -t rsa
, and by default these are being placed in /home/root/.ssh/id_rsa
. After which, I copy the public key to the remote server and can successfully ssh into the server from the NAS without a password. Testing with rsync works like a charm. A cronjob is then added to run a rsync bash script every day - so far so good.
However, on reboot the .ssh folder and all the keys are removed from the /home/root/
folder - I assume that entire folder gets wiped on reboot, as do folders like /root/
and others.
How do I prevent the /home/root/
folder from resetting every reboot?
Alternatively, I thought a good idea would be to use a new location for the ssh keys, and define the new folder using AuthorizedKeysFile
in the sshd_config file. However, other than user shares (i.e, /shares/
) I can't seem to find a directory that doesn't get wiped upon reboot.
Any ideas?
ssh
,backup
andrsync
are also not the real domains of this problem -- they are probablynas
,persistence
etc.