All Projects → emberstack → docker-sftp

emberstack / docker-sftp

Licence: MIT license
SFTP Server for Docker

Programming Languages

C#
18002 projects
Mustache
554 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to docker-sftp

Sftp
Securely share your files
Stars: ✭ 897 (+660.17%)
Mutual labels:  sftp, openssh
shim
The Userify Shim (cloud agent)
Stars: ✭ 57 (-51.69%)
Mutual labels:  openssh, openssh-server
aeneid
use your GitHub SSH keys to authenticate to sshd
Stars: ✭ 22 (-81.36%)
Mutual labels:  openssh, openssh-server
sftp-gateway
This repository contains a docker image configured to use the SSH File Transfer Protocol (SFTP) to transfer all its files to Cloud Blob Storage Services. This image can be deployed on a Kubernetes cluster with Helm.
Stars: ✭ 18 (-84.75%)
Mutual labels:  helm, sftp
helm-backup
Helm plugin which performs backup/restore of releases in a namespace to/from a file
Stars: ✭ 70 (-40.68%)
Mutual labels:  helm
helm-whatup
A Helm plugin to help users determine if there's an update available for their installed charts.
Stars: ✭ 37 (-68.64%)
Mutual labels:  helm
Helm-Cheat-Sheet
A cheat sheet for Helm commands.
Stars: ✭ 72 (-38.98%)
Mutual labels:  helm
kubetools
Kubetools - Curated List of Kubernetes Tools
Stars: ✭ 674 (+471.19%)
Mutual labels:  helm
gitops-kubernetes-cluster
A quick way to build a cluster with ArgoCD then deploy via Applications
Stars: ✭ 34 (-71.19%)
Mutual labels:  helm
crossover
Minimal sufficient Envoy xDS for Kubernetes that knows https://smi-spec.io/
Stars: ✭ 69 (-41.53%)
Mutual labels:  helm
helm-postgresql
Helm Chart for postgresql
Stars: ✭ 35 (-70.34%)
Mutual labels:  helm
hydralit
A library to create multi-page Streamlit applications with ease.
Stars: ✭ 93 (-21.19%)
Mutual labels:  secure
cortex-helm-chart
Helm chart for Cortex
Stars: ✭ 134 (+13.56%)
Mutual labels:  helm
helm2-mixin
Helm mixin for Porter
Stars: ✭ 14 (-88.14%)
Mutual labels:  helm
metahelm
Install dependency graphs of Kubernetes Helm Charts
Stars: ✭ 70 (-40.68%)
Mutual labels:  helm
python-helm
python client for helm
Stars: ✭ 17 (-85.59%)
Mutual labels:  helm
vault-charts
Charts to deploy Hashicorp Vault in Kubernetes
Stars: ✭ 15 (-87.29%)
Mutual labels:  helm
charts
Helm charts for creating reproducible and maintainable deployments of Polyaxon with Kubernetes.
Stars: ✭ 32 (-72.88%)
Mutual labels:  helm
charts
Fairwinds helm chart repository
Stars: ✭ 99 (-16.1%)
Mutual labels:  helm
helm-inject
Inject additional configurations during Helm upgrade
Stars: ✭ 17 (-85.59%)
Mutual labels:  helm

SFTP (SSH File Transfer Protocol) server using OpenSSH

This project provides a Docker image for hosting a SFTP server. Included are Docker (docker-cli and docker-compose) and Kubernetes (kubectl and helm) deployment scripts

Pipeline Release Docker Image Docker Pulls license

Supports architectures: amd64, arm and arm64

Support

If you need help or found a bug, please feel free to open an issue on the emberstack/docker-sftp GitHub project.

Usage

The SFTP server can be easily deployed to any platform that can host containers based on Docker. Below are deployment methods for:

  • Docker CLI
  • Docker-Compose
  • Kubernetes using Helm (recommended for Kubernetes)

Process:

  1. Create server configuration
  2. Mount volumes as needed
  3. Set host file for consistent server fingerprint

Configuration

The SFTP server uses a json based configuration file for default server options and to define users. This file has to be mounted on /app/config/sftp.json inside the container. Environment variable based configuration is not supported (see the Advanced Configuration section below for the reasons).

Below is the simplest configuration file for the SFTP server:

{
    "Global": {
        "Chroot": {
            "Directory": "%h",
            "StartPath": "sftp"
        },
        "Directories": ["sftp"]
    },
    "Users": [
        {
            "Username": "demo",
            "Password": "demo"
        }
    ]
}

This configuration creates a user demo with the password demo. A directory "sftp" is created for each user in the own home and is accessible for read/write. The user is chrooted to the /home/demo directory. Upon connect, the start directory is sftp.

You can add additional users, default directories or customize start directories per user. You can also define the UID and GID for each user. See the Advanced Configuration section below for all configuration options.

Deployment using Docker CLI

Simple Docker CLI run

$ docker run -p 22:22 -d emberstack/sftp --name sftp

This will start a SFTP in the container sftp with the default configuration. You can connect to it and login with the user: demo and password: demo.

Provide your configuration

$ docker run -p 22:22 -d emberstack/sftp --name sftp -v /host/sftp.json:/app/config/sftp.json:ro

This will override the default (/app/config/sftp.json) configuration with the one from the host /host/sftp.json.

Mount a directory from the host for the user 'demo'

$ docker run -p 22:22 -d emberstack/sftp --name sftp -v /host/sftp.json:/app/config/sftp.json:ro -v /host/demo:/home/demo/sftp

This will mount the demo directory from the host on the sftp directory for the "demo" user.

Deployment using Docker Compose

Simple docker-compose configuration

Create a docker-compose configuration file:

version: '3'
services:
  sftp:
    image: "emberstack/sftp"
    ports:
      - "22:22"
    volumes:
      - ../config-samples/sample.sftp.json:/app/config/sftp.json:ro

And run it using docker-compose

$ docker-compose -p sftp -f docker-compose.yaml up -d

The above configuration is available in the deploy\docker-compose folder in this repository. You can use it to start customizing the deployment for your environment.

Deployment to Kubernetes using Helm

Use Helm to install the latest released chart:

$ helm repo add emberstack https://emberstack.github.io/helm-charts
$ helm repo update
$ helm upgrade --install sftp emberstack/sftp

You can customize the values of the helm deployment by using the following Values:

Parameter Description Default
nameOverride Overrides release name ""
fullnameOverride Overrides release fullname ""
image.repository Container image repository emberstack/sftp
image.tag Container image tag latest
image.pullPolicy Container image pull policy Always if image.tag is latest, else IfNotPresent
storage.volumes Defines additional volumes for the pod {}
storage.volumeMounts Defines additional volumes mounts for the sftp container {}
configuration Allows the in-line override of the configuration values null
configuration.Global.Chroot.Directory Global chroot directory for the sftp user group. Can be overriden per-user "%h"
configuration.Global.Chroot.StartPath Start path for the sftp user group. Can be overriden per-user "sftp"
configuration.Global.Directories Directories that get created for all sftp users. Can be appended per user ["sftp"]
configuration.Global.HostKeys.Ed25519 Set the server's ED25519 private key ""
configuration.Global.HostKeys.Rsa Set the server's RSA private key ""
configuration.Users Array of users and their properties Contains demo user by default
configuration.Users[].Username Set the user's username N/A
configuration.Users[].Password Set the user's password. If empty or null, password authentication is disabled N/A
configuration.Users[].PasswordIsEncrypted true or false. Indicates if the password value is already encrypted false
configuration.Users[].AllowedHosts Set the user's allowed hosts. If empty, any host is allowed []
configuration.Users[].PublicKeys Set the user's public keys []
configuration.Users[].UID Sets the user's UID. null
configuration.Users[].GID Sets the user's GID. A group is created for this value and the user is included null
configuration.Users[].Chroot If set, will override global Chroot settings for this user. null
configuration.Users[].Directories Array of additional directories created for this user null
initContainers Additional initContainers for the pod {}
resources Resource limits {}
nodeSelector Node labels for pod assignment {}
tolerations Toleration labels for pod assignment []
affinity Node affinity for pod assignment {}

Find us on Helm Hub

Advanced Configuration

TODO: This section is under development due to the number of configuration options being added. Please open an issue on the emberstack/docker-sftp project if you need help.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].