mirror of
https://github.com/atmoz/sftp.git
synced 2024-11-17 12:51:33 -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 apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssh-server
|
||||||
|
|
||||||
RUN mkdir -p /var/run/sshd
|
RUN mkdir -p /var/run/sshd
|
||||||
RUN addgroup --system sftp
|
|
||||||
|
|
||||||
ADD . /root
|
ADD . /root
|
||||||
WORKDIR /root
|
WORKDIR /root
|
||||||
|
|
4
run
4
run
|
@ -7,11 +7,11 @@ for userData in "${users[@]}"; do
|
||||||
user="${data[0]}"
|
user="${data[0]}"
|
||||||
pass="${data[1]}"
|
pass="${data[1]}"
|
||||||
|
|
||||||
useradd -G sftp $user
|
useradd $user
|
||||||
echo "$user:$pass" | chpasswd
|
echo "$user:$pass" | chpasswd
|
||||||
chown root:root /home/$user
|
chown root:root /home/$user
|
||||||
chmod 755 /home/$user
|
chmod 755 /home/$user
|
||||||
chown -R $user:sftp /home/$user/*
|
chown -R $user:users /home/$user/*
|
||||||
done
|
done
|
||||||
|
|
||||||
# Run SSH
|
# Run SSH
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
PermitRootLogin no
|
PermitRootLogin no
|
||||||
#ChallengeResponseAuthentication no
|
|
||||||
UsePAM no
|
|
||||||
Subsystem sftp internal-sftp
|
Subsystem sftp internal-sftp
|
||||||
|
|
||||||
Match group sftp
|
|
||||||
ChrootDirectory %h
|
ChrootDirectory %h
|
||||||
X11Forwarding no
|
X11Forwarding no
|
||||||
AllowTcpForwarding no
|
AllowTcpForwarding no
|
||||||
|
|
Loading…
Reference in a new issue