Find the answer to your Linux question:
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.
  1. #1
    Just Joined!
    Join Date
    Feb 2014
    Posts
    2

    Backing up the / file system using duply and keyless login


    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 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.

  2. #2
    Linux Engineer docbop's Avatar
    Join Date
    Nov 2009
    Location
    Woodshed, CA
    Posts
    949
    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.

  3. #3
    Just Joined!
    Join Date
    Feb 2014
    Posts
    2
    Quote Originally Posted by docbop View Post
    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.
    Apologies. Hopefully this is a clearer explanation

    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?

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •