mirror of
https://github.com/atmoz/sftp.git
synced 2024-12-22 13:14:42 -05:00
No need for group, forced sftp
This commit is contained in:
parent
17c854b0f6
commit
2505784452
3 changed files with 6 additions and 11 deletions
|
@ -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
|
||||
|
|
4
run
4
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
|
||||
|
|
12
sshd_config
12
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue