Add local_root user support

This commit is contained in:
Tim Robinson
2015-12-17 11:39:31 +11:00
parent 2e88b706bb
commit 0d5942cfe3
2 changed files with 7 additions and 0 deletions

View File

@@ -27,6 +27,8 @@ which is in the _whois_ debian package.
- `FTP_USER_*`: Adds mutliple users. Value must be in the form of `username:hash`. Should not be used in conjunction with `FTP_USER` and `FTP_PASSWORD(_HASH)`.
- `FTP_USERS_ROOT`: sets `local_root=/srv/$USER` so each user is chrooted to their own directory instead of a shared one.
## Usage Example
```

View File

@@ -20,6 +20,11 @@ while read user; do
/add-virtual-user.sh "$name" "$pass"
done < <(env | grep "FTP_USER_" | sed 's/^\(FTP_USER_[a-zA-Z0-9]*\)=.*/\1/')
# Support user directories
if [ ! -z "$FTP_USERS_ROOT" ]; then
sed -i 's/local_root=.*/local_root=\/srv\/$USER/' /etc/vsftpd*.conf
fi
function vsftpd_stop {
echo "Received SIGINT or SIGTERM. Shutting down vsftpd"
# Get PID