Vsftp Installation: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Zeile 91: | Zeile 91: | ||
*'''systemctl restart vsftpd.service''' | *'''systemctl restart vsftpd.service''' | ||
=vsftpd mit SSL/TLS - Kontrolle= | =vsftpd mit SSL/TLS - Kontrolle= | ||
+ | *Zugriff über einen ftp Client, z.Bsp. Filezilla | ||
+ | *Als Encryption 'Require explicit FTP over TLS' auswählen |
Version vom 16. Februar 2023, 11:06 Uhr
installation
sudo apt-get update sudo apt-get install vsftpd
vsftpd test configuration
mkdir -p /var/ftp/pub chown nobody:nogroup /var/ftp/pub echo "vsftpd test file" | sudo tee /var/ftp/pub/test.txt
- add / change in vi /etc/vsftp.conf
anonymous_enable=YES # # Point users at the directory we created earlier. anon_root=/var/ftp/ # # Stop prompting for a password on the command line. no_anon_password=YES # # Show the user and group as ftp:ftp, regardless of the owner. hide_ids=YES # # Limit the range of ports that can be used for passive FTP pasv_min_port=40000 pasv_max_port=50000
- for passive mode add
pasv_enable=YES
- um schreibenden Zugriff zu erlauben, Kommentarzeichen vor folgender Zeile entfernen
#write_enable=YES
- Lokalen Benutzern Zugriff erlauben
local_enable=YES
- lokalen Benutzern anhand einer Benutzerliste Zugriff erlauben - nur diesen Benutzern ist Zugriff erlaubt:
userlist_enable=YES userlist_file=/etc/vsftpd.userlist userlist_deny=NO
- lokalen Benutzern anhand einer Benutzerliste Zugriff verbieten - anonymer Zugriff funktioniert weiterhin:
userlist_enable=YES userlist_file=/etc/vsftpd.userlist userlist_deny=YES
Restart & enable
systemctl restart vsftpd.service systemctl enable vsftpd.service
Testen des Zugriffs
- ftp localhost
Connected to localhost. 220 (vsFTPd 3.0.3) Name (localhost:dummy.user): anonymous 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files.
- Passiven Modus anschalten
- ftp> passive
Passive mode on.
- Verzeichnis wechseln und Testdatei herunterladen bzw. Testdatei hochladen
- ftp> cd pub
- ftp> get test.txt
- ftp> put test2.txt
vsftpd mit SSL/TLS - Erstellen des Zertifikates
- openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem
vsftpd mit SSL/TLS - Anpassen der vsftpd Konfiguration /etc/vsftpd.conf
anonymous_enable=NO write_enable=YES local_enable=YES userlist_enable=YES userlist_file=/etc/vsftpd.userlist userlist_deny=NO chroot_local_user=YES allow_writeable_chroot=YES # Alternatively: please consider using sFTP (FTP over SSH) or FTPs (FTP via TLS) with a modified, non-writeable, chroot. rsa_cert_file=/etc/ssl/private/vsftpd.pem rsa_private_key_file=/etc/ssl/private/vsftpd.pem ssl_enable=YES force_local_data_ssl=YES force_local_logins_ssl=YES ssl_tlsv1=YES ssl_sslv2=NO ssl_sslv3=NO require_ssl_reuse=NO ssl_ciphers=HIGH
- Restarten vsftpd
- systemctl restart vsftpd.service
vsftpd mit SSL/TLS - Kontrolle
- Zugriff über einen ftp Client, z.Bsp. Filezilla
- Als Encryption 'Require explicit FTP over TLS' auswählen