Automated Backups With rdiff-backup

Discussion in 'Server Operation' started by comrade_bronski, Jul 5, 2006.

  1. comrade_bronski

    comrade_bronski New Member

    I been following the tutorial by the letter - I've been over it three times, but no luck. I've also read a number of posts in the forum archives, but they are no help.

    When I execute the following command:

    rdiff-backup rogue_backup::/boot boot

    It asks me for a password... As I don't completely understand the mechanics behind the setting up of the rdiff user account (I called mine rdiff as opposed to rdiff_backup - the ONLY change I made) I'm not sure were to start looking for the problem.

    Please help - what can I do to figure out where my problem is?
  2. Hans

    Hans Moderator ISPConfig Developer

    Did you use nano, an editor which comes with with Debian?
    If so, you better use the vi editor. I followed the turorial by the letter too and i discovered that the nano editor was the reason rdiff-backup was not functioning as it should.
  3. comrade_bronski

    comrade_bronski New Member

    I saw that from your previous post... very odd - any idea what caused it?
    Any way I used emacs on "backup" and gedit on "server" (the machine to be backed up).

    I'll try (in the morning) using vi on both and see if it helps.

  4. Hans

    Hans Moderator ISPConfig Developer

    I do not know the reason, but Falko told me.

    In the rdiff-how to, you also find this lines:

    (Note (a little off-topic): on Debian Sarge crontab -e will automatically open the editor nano. If you are used to working with the editor vi (like me), run the following commands:

    rm -f /etc/alternatives/editor
    ln -s /usr/bin/vi /etc/alternatives/editor

    Afterwards, run crontab -e, and vi will come up.)

    I do not know sure that it is going to work for you but using the vi editor was the solution for me.
    Good luck!
  5. comrade_bronski

    comrade_bronski New Member

    hmmm - no luck! I checked the two files (authorized_keys on the server & config on the backup machine) in vi and could see nothing wrong.

    So I started from scratch and exactly the same thing happened again. When I ran the final command it still asks me for a password (see below). I'm running Debian Sarge with up-to-date packages. I've also included below the files and errors.

    Any further suggestions?


    beast:/backup/.ssh# su -m rdiff
    [email protected]:~/.ssh$ cd /backup
    [email protected]:~$ rdiff-backup rogue_backup::/boot boot
    Permission denied (publickey,keyboard-interactive).
    Fatal Error: Truncated header string (problem probably originated remotely)

    Couldn't start up the remote connection by executing

    ssh -C rogue_backup rdiff-backup --server

    Remember that, under the default settings, rdiff-backup must be
    installed in the PATH on the remote system. See the man page for more
    information on this. This message may also be displayed if the remote
    version of rdiff-backup is quite different from the local version (0.13.4).


    config reads:

    host rogue_backup
    hostname rogue
    user root
    identityfile /backup/.ssh/id_rsa
    compression yes
    cipher blowfish
    protocol 2


    authorized_keys (key removed):

    command="rdiff-backup --server --restrict-read-only /",from="",no-port-forwarding,no-X11-forwarding,no-pty ssh-rsa AAAb[----]jhw0= [email protected]
  6. falko

    falko Super Moderator ISPConfig Developer

    Did you try to follow the tutorial as _close_ as possible? Checked for typos, etc.?
  7. comrade_bronski

    comrade_bronski New Member

    OK - I'm now able to login without the use of a password. I managed this by following a slightly different tutorial:

    The only real difference here was that the login was tested before the authorized_keys folder was updated. I must have completed the tutorial maybe 4 times... doesn't sy much for my accuracy, but I think perhaps I wan't logged in as root when I sent the public key to the machine I was attempting to connect to.

    Any way the above tutorial was slightly more incremental in its steps, allowing for certain steps to be tested before moving on... perhaps an idea for the original tutorial on howtoforge....?

    Any way thanks for your help guys :)
  8. comrade_bronski

    comrade_bronski New Member

    Oh well - I'm a fool... when I said it was hanging, it was actually working DOH!


    AHA... the moment I add anything to authorized_keys - it breaks! I can login with out a password fine so long as I leave authorized_key without the additional comments, then I add the additional line so authorized_keys reads:

    command="rdiff-backup --server --restrict-read-only /",from="beast",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAA[---]rE= [email protected]

    I then try to login using the backup account and it simply hangs

    if I change from="beast" to from=""

    I get asked for a password....

    At least I've tracked down the problem to this file... I just can't see what would break it...? Any ideas?
    Last edited: Jul 6, 2006
  9. Hans

    Hans Moderator ISPConfig Developer

    In the how to about rdiff-backup is mentioned at a certain Point that you have to follow the instructions as user rdiff-backup. So do not follow the instructions from that moment as root.
  10. falko

    falko Super Moderator ISPConfig Developer

    You must use a FQDN like that exists in DNS. What's the output of
    hostname -f
    of your backup machine?

Share This Page