From 60ab7d2f4f701cdaeac448db1ea872943961a46d Mon Sep 17 00:00:00 2001 From: Adrian Dvergsdal Date: Tue, 21 Oct 2014 10:42:49 +0200 Subject: [PATCH] Require user to handle file permissions --- README.md | 4 ++-- run | 16 ---------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 39b5fb8..1ff6f71 100644 --- a/README.md +++ b/README.md @@ -53,11 +53,11 @@ docker run \ Tip: you can use makepasswd to generate encrypted passwords: `echo -n 123 | makepasswd --crypt-md5 --clearfrom -` -### Use public key (without password) +### Using SSH key (without password) ``` docker run \ - -v /host/id_rsa.pub:/public_keys/foo:ro \ + -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 diff --git a/run b/run index 57c9a44..1130f5c 100644 --- a/run +++ b/run @@ -30,26 +30,10 @@ for users in "$@"; do chmod 755 /home/$user if [ -z "$pass" ]; then - # just make a very long and random password pass="$(echo `/dev/null 2>&1; then - mkdir -p /home/$user/.ssh - cp $user /home/$user/.ssh/authorized_keys - chown $user:users /home/$user/.ssh/authorized_keys - fi -done -cd /root - exec /usr/sbin/sshd -D