add ftp server
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
vsftpd \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY conf/vsftpd.conf /etc/vsftpd.conf
|
||||
COPY tools/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
|
||||
RUN echo "/usr/sbin/nologin" >> /etc/shells \
|
||||
&& chmod +x /usr/local/bin/entrypoint.sh
|
||||
|
||||
EXPOSE 21 21100-21110
|
||||
|
||||
ENTRYPOINT ["entrypoint.sh"]
|
||||
@@ -0,0 +1,19 @@
|
||||
listen=YES
|
||||
listen_ipv6=NO
|
||||
|
||||
anonymous_enable=NO
|
||||
local_enable=YES
|
||||
write_enable=YES
|
||||
|
||||
chroot_local_user=YES
|
||||
allow_writeable_chroot=YES
|
||||
local_umask=022
|
||||
|
||||
pasv_enable=YES
|
||||
pasv_min_port=21100
|
||||
pasv_max_port=21110
|
||||
|
||||
seccomp_sandbox=NO
|
||||
|
||||
xferlog_enable=YES
|
||||
dual_log_enable=YES
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
mkdir -p /var/run/vsftpd/empty
|
||||
|
||||
FTP_PASSWORD=$(cat /run/secrets/ftp_password)
|
||||
|
||||
if ! id "${FTP_USER}" >/dev/null 2>&1; then
|
||||
useradd -o -u 33 -g www-data -d /var/www/html -s /usr/sbin/nologin "${FTP_USER}"
|
||||
fi
|
||||
|
||||
echo "${FTP_USER}:${FTP_PASSWORD}" | chpasswd
|
||||
|
||||
exec /usr/sbin/vsftpd /etc/vsftpd.conf
|
||||
Reference in New Issue
Block a user