Sign inSign up

zyfax/ssh-rsync

By zyfax

•Updated almost 3 years ago

Image
0

883

zyfax/ssh-rsync repository overview

⁠Alpine Linux with SSH Server for Remote Access

This Docker image is built on the lightweight Alpine Linux and comes equipped with an SSH server, allowing for secure remote logins. Additionally, rsync has been pre-installed, making this container perfect for those looking to utilize rsync over SSH, especially when the endpoint requires rsync compatibility. Ideal for efficient data synchronization and secure remote management.

version: '3.9'

services:
  ssh-rsync:
    image: zyfax/ssh-rsync
    container_name: ssh-rsync
    ports:
      - "2222:22"
    environment:
      - SSH_UID=1000
      - SSH_GID=1000
      - SSH_USER=username
      - SSH_PASS=password
    volumes:
      - ./config:/etc/ssh # to save ssh-keys
      - /user/path:/home/username
    restart: unless-stopped
⁠Ports:

"2222:22": This maps port 22 inside the container (commonly used for SSH) to port 2222 on the host machine. This means that to SSH into the container from the host or any other machine, you'd connect to port 2222.

⁠Environment:

SSH_UID=1000: This sets an environment variable inside the container named SSH_UID with a value of 1000. This UID (User ID) will likely be used when creating or setting up the SSH user inside the container.

SSH_GID=1000: Similarly, this sets an environment variable for the GID (Group ID) of the SSH user inside the container.

SSH_USER=user: This specifies the username for the SSH user inside the container as "user".

SSH_PASS=password: This sets the password for the SSH user inside the container as "password".

⁠Volumes:

./config:/etc/ssh: This binds the local directory (on the host machine) named config (which should be located in the same directory as the docker-compose.yml file) to /etc/ssh inside the container. This is useful for persisting SSH keys and configuration across container restarts or rebuilds.

/user/path:/home/username: This binds the local directory /user/path on the host machine to /home/username inside the container. This can be used for persistent storage of user data or files, ensuring that data isn't lost even if the container is destroyed.

Tag summary

Content type

Image

Digest

sha256:b33a96469…

Size

4.8 MB

Last updated

almost 3 years ago

docker pull zyfax/ssh-rsync