#!/usr/bin/env bash # VSFTPD Installer # Min. Requirement : GNU/Linux Ubuntu 18.04 # Last Build : 12/02/2022 # Author : MasEDI.Net (me@masedi.net) # Since Version : 1.0.0 # Include helper functions. if [[ "$(type -t run)" != "function" ]]; then BASE_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd ) # shellcheck disable=SC1091 . "${BASE_DIR}/utils.sh" # Make sure only root can run this installer script. requires_root "$@" # Make sure only supported distribution can run this installer script. preflight_system_check fi ## # Configure Vsftpd. ## function configure_vsftpd() { echo "Configuring FTP server (VSFTPD)..." if [[ "${DRYRUN}" != true ]]; then FTP_MIN_PORT=${FTP_MIN_PORT:-45000} FTP_MAX_PORT=${FTP_MAX_PORT:-45099} # Backup default vsftpd conf. if [ -f /etc/vsftpd.conf ]; then run mv /etc/vsftpd.conf /etc/vsftpd.conf.bak fi # Enable jail mode. run touch /etc/vsftpd.conf cat > /etc/vsftpd.conf <> /etc/vsftpd.conf < /etc/pam.d/vsftpd < /etc/ftpusers <