Alpine-based Docker image with SSH & rsync, user configurable at runtime
142
This Docker image, based on Alpine Linux, provides a lightweight environment equipped with OpenSSH server and rsync tool. It is intended to facilitate secure file transfer between containers or from host to container. SSH is configured to run on the default port 22 and rsync is available for synchronizing files.
The image uses an entrypoint script that sets up a user based on provided environment variables (USER_NAME and USER_PASSWORD) at runtime. This feature provides flexibility to define the username and password dynamically when starting the container.
Here's a usage example:
docker run -d -p 22:22 -e USER_NAME=myuser -e USER_PASSWORD=mypassword my_sshd_image
This command runs a new container in the background, maps port 22 of the container to port 22 of the host machine, and creates a user named 'myuser' with password 'mypassword'.
Security considerations:
Exposing SSH port: While this image exposes the default SSH port (22), you should consider mapping it to a different port on the host machine to reduce exposure to automated attacks.
User authentication: This image uses password authentication for SSH. For stronger security, consider using key-based authentication.
Secure password: Make sure to use strong, complex passwords for the SSH user to reduce the risk of brute force attacks.
IP access control: Consider implementing firewall rules or security groups to restrict which IP addresses can connect to the SSH port.
Environment variables: Be aware that Docker can log environment variables, so sensitive data such as passwords can be exposed in logs.
This Docker image is intended for use in development or testing environments. For production use, a more secure setup would be recommended. Always follow best practices for security when deploying Docker containers.
Content type
Image
Digest
sha256:cec21dae4…
Size
8 MB
Last updated
over 3 years ago
docker pull fabiomazzo/alpine-ssh-rsync:1.2