Add local_root user support
This commit is contained in:
@@ -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_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
|
## Usage Example
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
5
entry.sh
5
entry.sh
@@ -20,6 +20,11 @@ while read user; do
|
|||||||
/add-virtual-user.sh "$name" "$pass"
|
/add-virtual-user.sh "$name" "$pass"
|
||||||
done < <(env | grep "FTP_USER_" | sed 's/^\(FTP_USER_[a-zA-Z0-9]*\)=.*/\1/')
|
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 {
|
function vsftpd_stop {
|
||||||
echo "Received SIGINT or SIGTERM. Shutting down vsftpd"
|
echo "Received SIGINT or SIGTERM. Shutting down vsftpd"
|
||||||
# Get PID
|
# Get PID
|
||||||
|
|||||||
Reference in New Issue
Block a user