You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.6 KiB

  1. #+PROPERTY: Effort_ALL 0 0:30 1:00 2:00 0.5d 1d 1.5d 2d 3d 4d 5d
  2. #+PROPERTY: Max_effort_ALL 0 0:30 1:00 2:00 0.5d 1d 1.5d 2d 3d 4d 5d
  3. #+PROPERTY: header-args:python :var filename=(buffer-file-name)
  4. #+PROPERTY: header-args:sh :var filename=(buffer-file-name)
  5. #+TODO: TODO WIP BLOCKED | DONE CANCELED
  6. #+LATEX_HEADER: \usepackage[margin=0.5in]{geometry}
  7. #+LaTeX_HEADER: \hypersetup{linktoc = all, colorlinks = true, urlcolor = DodgerBlue4, citecolor = PaleGreen1, linkcolor = blue}
  8. #+LaTeX_CLASS: article
  9. #+OPTIONS: H:8 ^:nil prop:("Effort" "Max_effort") tags:not-in-toc
  10. #+COLUMNS: %50ITEM %Effort(Min Effort) %Max_effort(Max Effort)
  11. #+TITLE: rsync-backup-target
  12. #+LATEX: \pagebreak
  13. Usage of this service
  14. #+LATEX: \pagebreak
  15. #+LATEX: \pagebreak
  16. * Configuration example
  17. #+begin_src yaml
  18. rsync-backup-target:
  19. # docker-compose:
  20. # ports:
  21. # - "10023:22"
  22. options:
  23. admin: ## These keys are for the allowed rsync-backup to write stuff with rsync
  24. myadmin: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDESdz8bWtVcDQJ68IE/KpuZM9tAq\
  25. ZDXGbvEVnTg16/yWqBGQg0QZdDjISsPn7D3Zr64g2qgD9n7EZghfGP9TkitvfrBYx8p\
  26. 7JkkUyt8nxklwOlKZFD5b3PF2bHloSsmjnP8ZMp5Ar7E+tn1guGrCrTcFIebpVGR3qF\
  27. hRN9AlWNR+ekWo88ZlLJIrqD26jbWRJZm4nPCgqwhJwfHE3aVwfWGOqjSp4ij+jr2ac\
  28. Arg7eD4clBPYIqKlqbfNRD5MFAH9sbB6jkebQCAUwNRwV7pKwCEt79HnCMoMjnZh6Ww\
  29. 6TlHIFw936C2ZiTBuofMx7yoAeqpifyzz/T5wsFLYWwSnX rsync@zen"
  30. #+end_src
  31. ** Adding new keys for backup
  32. This can be done through the admin accounts configured in =compose.yml=.
  33. You can use then =ssh myadmin@$RSYNC_BACKUP_TARGET ssh-key=:
  34. #+begin_example
  35. $ ssh myadmin@$RSYNC_BACKUP_TARGET ssh-key ls
  36. $ ssh myadmin@$RSYNC_BACKUP_TARGET ssh-key add "ssh-rsa AAA...Jdhwhv rsync@sourcelabel"
  37. $ ssh myadmin@$RSYNC_BACKUP_TARGET ssh-key ls
  38. ..Jdhwhv sourcelabel
  39. $ ssh myadmin@$RSYNC_BACKUP_TARGET ssh-key rm sourcelabel
  40. $ ssh myadmin@$RSYNC_BACKUP_TARGET ssh-key ls
  41. $
  42. #+end_example
  43. * Troubleshooting
  44. ** Faking access from client
  45. This should work:
  46. #+begin_src sh
  47. RSYNC_BACKUP_TARGET_IP=172.18.0.2
  48. rsync -azvA -e "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" \
  49. /tmp/toto "$RSYNC_BACKUP_TARGET":/var/mirror/client1
  50. #+end_src
  51. ** Direct ssh access should be refused
  52. #+begin_src sh
  53. RSYNC_BACKUP_TARGET_IP=172.18.0.2
  54. ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \
  55. "$RSYNC_BACKUP_TARGET"
  56. #+end_src
  57. ** Wrong directory should be refused
  58. #+begin_src sh
  59. RSYNC_BACKUP_TARGET_IP=172.18.0.2
  60. rsync -azvA -e "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" \
  61. /tmp/toto "$RSYNC_BACKUP_TARGET":/var/mirror/client2
  62. #+end_src