-
Notifications
You must be signed in to change notification settings - Fork 0
FTP Server
- file transfer over TCP/IP
- created in 1971
- RFC 3659 (1985)
- FTPS is a secure variant
- well known ports 21 for commands and 20 for data
modes
-
active : client tells server which port to connect back : can cause issue with client firewalls
-
passive : server tells client which port to connect = most common for containerized FTP servers port
-
21 for control
-
but we need to map a passive port range (ex 20000-20009:20000-20009)
Note
user name and password are transmitted unencrypted in FTP if using an account with sudo rights with ftp, do it over ssh or an other secure protocol (POPs)
- server should chroot users to their home directory
- FTPS configuration (over SSL/TLS)
- strong password policies
- firewall rules : only trusted IPs
Very Secure FTP Daemon
more flexible but complex to configure
Default vsftps config is very restrictive
cf
relaunch server after modifs sudo service vsftpd reload
- check connected users
ps -aef | grep vsftpd
use cases
- backup website
- upload content
- mirror to update from local site or make a local copy
- put to update a file
# -e to pass a command
# mirror creates an exact copy
# -e erase non existing files
# -R from local to remote
# -x to ignore
lftp ftp://login:password@host -e "mirror -e -R -x <ignoredDir> /var/www/site / ; quit" cf
- logs
sudo tail -f /var/log/vsftpd.log
- lsof to check ports the FTP is listening on
Gemini https://fr.wikipedia.org/wiki/File_Transfer_Protocol https://doc.ubuntu-fr.org/vsftpd https://www.digitalocean.com/community/tutorials/how-to-set-up-vsftpd-for-a-user-s-directory-on-debian-10