add static user possibility
This commit is contained in:
parent
fe187a7160
commit
28930cd837
4 changed files with 34 additions and 2 deletions
|
@ -20,6 +20,10 @@ WtmpLog off
|
|||
LoadModule mod_ldap.c
|
||||
LoadModule mod_sftp.c
|
||||
|
||||
{{if (getenv "STATIC_USER")}}
|
||||
AuthUserFile /etc/proftpd/passwd
|
||||
{{end}}
|
||||
|
||||
<IfModule mod_sftp.c>
|
||||
SFTPEngine on
|
||||
SFTPAuthMethods password
|
||||
|
@ -28,6 +32,7 @@ LoadModule mod_sftp.c
|
|||
SFTPOptions IgnoreSCPUploadPerms IgnoreSFTPUploadPerms
|
||||
</IfModule>
|
||||
|
||||
{{if (getenv "LDAP_URI")}}
|
||||
<IfModule mod_ldap.c>
|
||||
AuthOrder mod_ldap.c
|
||||
|
||||
|
@ -47,3 +52,4 @@ LoadModule mod_sftp.c
|
|||
LDAPGenerateHomedirPrefix /var/lib/ftp/data
|
||||
LDAPForceGeneratedHomedir on
|
||||
</IfModule>
|
||||
{{end}}
|
||||
|
|
14
rootfs/etc/cont-init.d/04-static-user
Normal file
14
rootfs/etc/cont-init.d/04-static-user
Normal file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/with-contenv sh
|
||||
|
||||
if [ ! -z ${STATIC_USER+x} ]; then
|
||||
ftpasswd \
|
||||
--sha512 \
|
||||
--passwd \
|
||||
--home /var/lib/ftp/data \
|
||||
--uid ${STATIC_UID} \
|
||||
--gid ${STATIC_GID} \
|
||||
--name ${STATIC_USER} \
|
||||
--shell /bin/sh \
|
||||
--file /etc/proftpd/passwd \
|
||||
--stdin ${STATIC_PASSWORD}
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue