forked from 0k/0k-charms
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
23 lines
438 B
#!/bin/bash
|
|
|
|
|
|
##
|
|
## code
|
|
##
|
|
|
|
chmod 440 /etc/sudoers.d/* -R
|
|
|
|
KEYS=/etc/rsync/keys/
|
|
RSYNC_HOME=/var/lib/rsync
|
|
|
|
mkdir -p "$RSYNC_HOME/.ssh"
|
|
|
|
for f in "$KEYS"/*; do
|
|
[ -e "$f" ] || continue
|
|
content=$(cat "$f")
|
|
echo "command=\"/usr/local/sbin/ssh-cmd-validate\" $content"
|
|
done > "$RSYNC_HOME"/.ssh/authorized_keys
|
|
chown rsync:rsync -R "$RSYNC_HOME"/.ssh -R
|
|
|
|
## Give back PID 1 so that ssh can receive signals
|
|
exec /usr/sbin/sshd -D
|