From 2505784452211ad19487af5e3fb7a3fc1ed1fc2d Mon Sep 17 00:00:00 2001 From: Adrian Dvergsdal Date: Thu, 16 Oct 2014 22:07:39 +0200 Subject: [PATCH] No need for group, forced sftp --- Dockerfile | 1 - run | 4 ++-- sshd_config | 12 ++++-------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0d7087f..0e902a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,6 @@ MAINTAINER Adrian Dvergsdal RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssh-server RUN mkdir -p /var/run/sshd -RUN addgroup --system sftp ADD . /root WORKDIR /root diff --git a/run b/run index d443a7a..a79cf86 100644 --- a/run +++ b/run @@ -7,11 +7,11 @@ for userData in "${users[@]}"; do user="${data[0]}" pass="${data[1]}" - useradd -G sftp $user + useradd $user echo "$user:$pass" | chpasswd chown root:root /home/$user chmod 755 /home/$user - chown -R $user:sftp /home/$user/* + chown -R $user:users /home/$user/* done # Run SSH diff --git a/sshd_config b/sshd_config index 4a21d09..46d0821 100644 --- a/sshd_config +++ b/sshd_config @@ -1,11 +1,7 @@ PermitRootLogin no -#ChallengeResponseAuthentication no -UsePAM no Subsystem sftp internal-sftp - -Match group sftp - ChrootDirectory %h - X11Forwarding no - AllowTcpForwarding no - ForceCommand internal-sftp +ChrootDirectory %h +X11Forwarding no +AllowTcpForwarding no +ForceCommand internal-sftp