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.

23 lines
438 B

  1. #!/bin/bash
  2. ##
  3. ## code
  4. ##
  5. chmod 440 /etc/sudoers.d/* -R
  6. KEYS=/etc/rsync/keys/
  7. RSYNC_HOME=/var/lib/rsync
  8. mkdir -p "$RSYNC_HOME/.ssh"
  9. for f in "$KEYS"/*; do
  10. [ -e "$f" ] || continue
  11. content=$(cat "$f")
  12. echo "command=\"/usr/local/sbin/ssh-cmd-validate\" $content"
  13. done > "$RSYNC_HOME"/.ssh/authorized_keys
  14. chown rsync:rsync -R "$RSYNC_HOME"/.ssh -R
  15. ## Give back PID 1 so that ssh can receive signals
  16. exec /usr/sbin/sshd -D