Easy to use SFTP (SSH File Transfer Protocol) server with OpenSSH.
docker run, one user per argument. Options in square brackets are optional.
(syntax: user:pass[:e][:[uid][:gid][:home]]).
Assuming you've launched wordpress with the conatainer --name wordpress
docker run --volumes-from wordpress --name wordpress-sftp -p 2222:22 -d ironside/sftp foo:123:1000::/var/www
creates a user foo that can access the wordpress files under the /html folder
docker run \
-v /host/share:/home/foo/share \
-p 2222:22 -d atmoz/sftp \
foo:123:1001
For example, to provide SFTP access to a location provided by another container via --volumes-from
docker run \
-v /host/share:/home/foo/share \
-p 2222:22 -d atmoz/sftp \
foo:123:1001:/desired/home/folder
docker run \
-v /host/share:/home/foo/share \
-v /host/documents:/home/foo/documents \
-v /host/http:/home/bar/http \
-p 2222:22 -d atmoz/sftp \
foo:123:1001 \
bar:abc:1002
Add :e behind password to mark it as encrypted. Use single quotes.
docker run \
-v /host/share:/home/foo/share \
-p 2222:22 -d atmoz/sftp \
'foo:$1$0G2g0GSt$ewU0t6GXG15.0hWoOX8X9.:e:1001'
Tip: you can use makepasswd to generate encrypted passwords:
echo -n 123 | makepasswd --crypt-md5 --clearfrom -
docker run \
-v /host/id_rsa.pub:/home/foo/.ssh/authorized_keys:ro \
-v /host/share:/home/foo/share \
-p 2222:22 -d atmoz/sftp \
foo::1001
Content type
Image
Digest
sha256:7e0ea586e…
Size
47.7 MB
Last updated
almost 11 years ago
docker pull ironside/sftp