openssh-server restricted to rsync 🐳 https://hub.docker.com/r/fphammerle/rsync-sshd

Fabian Peter Hammerle 01a8169180 release v1.0.0 4 years ago
CHANGELOG.md c5853de140 release v1.0.0 4 years ago
Dockerfile 4443db5a55 upgrade base image from alpine v3.8 to v3.12; pin package versions 4 years ago
README.md 4443db5a55 upgrade base image from alpine v3.8 to v3.12; pin package versions 4 years ago
docker-compose.yml b8fe5c6c3d added docker-compose.yml for testing 4 years ago
entrypoint.sh 74b7d04201 replace `passwd -u` to avoid empty passwords 5 years ago
rsnapshot.conf.example 1f5a5417ab restrict ssh access via rrsync 5 years ago
sshd_config 1f5a5417ab restrict ssh access via rrsync 5 years ago

README.md

docker: openssh-server restricted to rsync 🐳

repo: https://github.com/fphammerle/docker-rsync-sshd

docker hub: https://hub.docker.com/r/fphammerle/rsync-sshd

SSH clients are restricted to rsync --server commands via rrsync.

rrsync prefixes /data to all paths (e.g., rsync ... host:/src /backup downloads /data/src).

example 1

$ docker run --name=rsync-sshd -p 2022:22 -e USERS=alice,bob -v rsync-data:/data:ro fphammerle/rsync-sshd
$ docker cp alice-keys rsync-sshd:/home/alice/.ssh/authorized_keys
$ docker cp bob-keys rsync-sshd:/home/bob/.ssh/authorized_keys

example 2

$ docker run --name rsync-sshd \
    --publish 2022:22 --env USERS=alice,bob \
    --volume accessible-data:/data:ro \
    --volume host-keys:/etc/ssh/host_keys \
    --volume alice-ssh-config:/home/alice/.ssh:ro \
    --volume bob-ssh-config:/home/bob/.ssh:ro \
    --init --rm \
    fphammerle/rsync-sshd
$ rsync -av --rsh='ssh -p 2022' alice@localhost:/source /target