使用 ~/.ssh/authorized_keys 来决定传入连接可以做什么 - Dan Langille 的其他日记

  • Key Information: .ssh/authorized_keys allows specifying the command for incoming ssh connections. In FreeBSD 14.2, backups of Bacula database and configuration are done via rsync to multiple hosts. On the dbclone host, lines in ~rsyncer/.ssh/authorized-keys specify conditions and commands for rsync. /usr/local/sbin/rrsync -ro /usr/home/rsyncer/backups/bacula-database/postgresql/ is a script that restricts rsync to a specific path and makes the session read-only. There is a script rsync-backup-from-x8dtu.sh on dbclone to copy a different database backup. Two ssh keys are needed for different tasks, and they are modified in authorized_keys and related scripts.
  • Main Views: Demonstrates how to use authorized_keys and related scripts to control ssh connections and rsync operations for different backup tasks.
  • Important Details: Specific commands and configurations for backup and ssh key management are detailed. For example, the specific paths and scripts used in different parts of the process. Also, the handling of multiple ssh keys for different tasks is emphasized.
阅读 11
0 条评论