A container with a user configured, an SSH server and rsync installed
  • Shell 67.2%
  • Makefile 21%
  • Dockerfile 11.8%
Find a file
Karl E. Jorgensen a5c81b9319
All checks were successful
Docker Build / build (push) Successful in 1m38s
Bugfix: Make sure the user's ~/.ssh (and below) has the correct ownership
2026-01-04 13:06:29 +00:00
.forgejo/workflows First cut 2026-01-03 23:49:59 +00:00
.dockerignore Feature: Add support for creating a user 2026-01-04 01:56:29 +00:00
Dockerfile Feature: Add support for creating a user 2026-01-04 01:56:29 +00:00
Makefile Feature: slightly better dev testing 2026-01-04 13:05:46 +00:00
README.md Feature: Add support for creating a user 2026-01-04 01:56:29 +00:00
rsync-entrypoint Bugfix: Make sure the user's ~/.ssh (and below) has the correct ownership 2026-01-04 13:06:29 +00:00

rsync

A simple container which provides an SSH server and has rsync installed.

This is based on https://code.jorgensen.org.uk/karl/ssh-container - see the README.md there for details about how to configure SSH keys.

This is intended as a simple utility to allow users to update files in e.g. a volume.

For most use cases we want a use a non-root user for access. This is controlled through environment variables:

  • USER_NAME specifies the username to be created. If this is not set, no user will be created.

  • USER_ID (optional) the numeric ID of the user. If not set, the container will choose a UID. Note that a container-chosen UID is not guarantteed to be consistent across invocations or container versions.

  • HOMEDIR (optional) The $HOME directory of the user. If not set, a suitable default will be used.

  • USER_SHELL (optional) - the user's shell.

  • GROUP_NAME (optional) name of the user's primary group

  • GROUP_ID (optional) numeric ID of GROUP_NAME

  • USER_COMMENT (optional) the comment (a.k.a. GECOS) information for the user.

  • USER_PUBKEY: The user's public key. This will be what ends up in the user's .ssh/authorized_keys file. This may contain newlines, which will allow for multiple keys.

    To limit the user to running rsync (or some other command), this can be done using the usual SSH facilities - see the man page for SSHD(8) - the AUTHORIZED_KEYS FILE FORMAT section.

NOTE: The user will be configured to not allow password-based logins. So setting USER_PUBKEY is quite essential.