Results 1 to 3 of 3
So I'm going round and round in circles and not getting anywhere. I'm trying to to get duply to back up a whole load of folders across my hdd starting ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-20-2014 #1
- Join Date
- Feb 2014
Backing up the / file system using duply and keyless login
I'm trying to to get duply to back up a whole load of folders across my hdd starting at / to a backup NAS that I have in my LAN. I want this to be automated and run rough cron so obviously need to use a keychain and ssh-keyless login so that when duply uses ssh and rsync to copy the data across to the backup NAS it's not held up asking for a password login.
What I'm getting in a pickle with is that in order to backup all the files via duply I need to run the command with root privileges otherwise it fails because it can't access files using the normal user. But whenever I generate ssh-key it generates it in my ~/.ssh dir which root won't have access to. And I'm guessing its a security risk to have root with a ssh-key?
I'd really appreciate some help with the best way to get this backup solution working as so far I've not had much luck finding a solution.
- 02-21-2014 #2
Having trouble following your post, do you have root access on the box you're trying to backup? Is the duply running on the box you're trying to backup or on another box? Is the NAS mounted on the box your trying to backup? Are you creating the cron job as root or logged in as yourself?
More details will help people be able to offer advice.
- 02-21-2014 #3
- Join Date
- Feb 2014
Computer A - machine to be backed up
Duply is installed and run as root so it can access /
Run as root cronjob rather than the user cronjob -- I'm not certain if this is correct?
Generated a rsa key pair but only for the user so it sits in $HOME/.ssh
Computer B - backup nas on same LAN
Has an Open SSH server running on it.
Duply is logging in a transferring files to this machine via rsync.
It needs to do this with a ssh-keychain -- this is where I'm having an issue.
The user that Computer A uses to login via SSH to Computer B is a standard user with a $HOME. It doesn't have root access to Machine B.
For security I've disabled root login via SSH on Computer B
So the problem is in order to get duply to acess the full / it needs to be run with sudo. In doing so when it runs rsync it tries to access the private /root/.ssh, keychain and ssh-agent as a pose to the user one and so fails to login into Computer B using a keychain.
Is there a way to correct this or should I be running the duply command in cron via a different user, instead of via a normal user but with sudo?