The FTP protocol has been around a long time, some of us remember using it fondly while others might shudder at the very mention of its name. The fact remains it’s not going away, and it does what it’s supposed to do very well: lightweight file transfer. Wrap this with TLS and it’s a fairly secure, cross-platform way of remote file transfer. A simple, lightweight but feature-filled FTP daemon I prefer is VSFTPD, but managing virtual users is still a manual process. I’ve written a simple user creation tool to make virtual users. Let’s get started.
Download the Tool
curl https://raw.githubusercontent.com/sadsfae/misc-scripts/master/shell/create-vsftpd-user.sh \ > create-vsftpd-user.sh && chmod +x create-vsftpd-user.sh
Install httpd-tools
This requires the htpasswd tool, usually packaged in the httpd-tools package
dnf install httpd-tools
Run the Tool
Follow the prompts, specifying username and password.
# ./create-vsftpd-user.sh ============================== = FTP Creator 3000 = ============================== Enter username: johnnyExample <--- enter a username Enter password: johnnyfivepassword <--- enter a password creating user johnnyExample setting password... Changing password for user johnnyExample. passwd: all authentication tokens updated successfully. Adding password for user johnnyExample ============================ Account Summary user: johnnyExample pass: johnnyfivepassword ============================
Github code is located here.