Update 23.09.2018: RuntimeDirectory hinzugefügt
Da ich mich wunderte, dass das ProFTPD Modul mod_vroot in vielen Distributionen nicht mehr verfügbar ist, hier mal der Debian-way.
Aktuelle mod_vroot Releases: https://github.com/Castaglia/proftpd-mod_vroot/releases
Aktuelle/stabile ProFTPD Version: http://www.proftpd.org/
Installation:
# Abhängigkeiten installieren apt-get build-dep proftpd-dfsg # Benutzer hinzufügen adduser --system --disabled-login --no-create-home --home /run/proftpd proftpd mkdir -p /run/proftpd chown proftpd:nogroup /run/proftpd # Herunterladen, bauen wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.6.tar.gz tar xfvz proftpd-1.3.6.tar.gz cd proftpd-1.3.6/contrib wget https://github.com/Castaglia/proftpd-mod_vroot/archive/v0.9.5.tar.gz tar xfvz v0.9.5.tar.gz mv proftpd-mod_vroot-0.9.5/ mod_vroot cd .. ./configure --prefix=/usr --sysconfdir=/etc/proftpd --localstatedir=/var --enable-openssl --with-modules=mod_vroot make make install
Eine Service-Datei („/etc/systemd/system/proftpd.service“):
[Unit] Description=ProFTPD FTP Server After=network.target [Service] Type=forking PIDFile=/run/proftpd/proftpd.pid ExecStart=/usr/sbin/proftpd ExecReload=/bin/kill -HUP $MAINPID RuntimeDirectory=proftpd [Install] WantedBy = multi-user.target
Mit anschließendem „systemctl enable proftpd.service“ aktivieren.
Eine Konfigurationsdatei (Beispiel):
ServerName "FTP" ServerIdent on "FTP Server ready." ServerAdmin cow@localhost PidFile /run/proftpd/proftpd.pid DefaultServer on VRootEngine on DefaultRoot ~ !adm AuthPAMConfig proftpd AuthOrder mod_auth_pam.c* mod_auth_unix.c UseReverseDNS off User proftpd Group nogroup MaxInstances 20 UseSendfile off LogFormat default "%h %l %u %t \"%r\" %s %b" LogFormat auth "%v [%P] %h %t \"%r\" %s" ListOptions -a RequireValidShell off PassivePorts 12000 12100Umask 002 IdentLookups off AllowOverwrite yes AllowAll
Das Modul muss nicht explizit geladen werden.