Skip to content

Commit

Permalink
feat: Enable vsftpd logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Timo Reymann authored and Timo Reymann committed Aug 11, 2022
1 parent 48eb182 commit a831131
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 0 additions & 3 deletions defaults/users
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
bob:s3cr3tCand!



10 changes: 5 additions & 5 deletions scripts/seed-config.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/sh

CONFIG_FILE=/etc/vsftpd/vsftpd.conf

VSFTPD_CONFIG_FILE=/etc/vsftpd/vsftpd.conf
VSFTPD_CONFIG="$(cat <<EOF
local_enable=YES
chroot_local_user=YES
Expand All @@ -17,20 +16,21 @@ pasv_address=${PUBLIC_HOST}
listen_ipv6=NO
seccomp_sandbox=NO
ftpd_banner=${BANNER}
vsftpd_log_file=$(tty)
EOF
)"

echo ""
printf "Append custom config to vsftpd config ... "
echo "$VSFTPD_CONFIG" >> $CONFIG_FILE
echo "$VSFTPD_CONFIG" >> "$VSFTPD_CONFIG_FILE"
echo "Done."

printf "Disable anonymous login ... "
sed -i "s/anonymous_enable=YES/anonymous_enable=NO/" $CONFIG_FILE
sed -i "s/anonymous_enable=YES/anonymous_enable=NO/" "$VSFTPD_CONFIG_FILE"
echo "Done."

printf "Remove suffixed whitespace from config ..."
sed -i 's,\r,,;s, *$,,' $CONFIG_FILE
sed -i 's,\r,,;s, *$,,' "$VSFTPD_CONFIG_FILE"
echo "Done."

echo ""

0 comments on commit a831131

Please sign in to comment.