#-Road-Map--------------------------------- # # FTP-Server # # Datum: Jan. 2025 (Geprüft) # # Eine "Strassenkarte" ist eine simple Text-Datei, # welche die Befehle zum kopieren und einfügen # im CLI oder auf dem Desktop bereitstellt und # zusätzlich einem einen Grobablauf einer Installation aufzeigt. #------------------------------------------ #------------------------------------------ # SSH-Verbindung #------------------------------------------ ssh DEINUSER@192.168.1.X #------------------------------------------ # System-Update / -Upgrade #------------------------------------------ sudo apt update sudo apt upgrade -y sudo apt autoclean sudo apt autoremove #------------------------------------------ # Statische IP Adresse #------------------------------------------ ip addr sudo su cd /etc/netplan ls for i in $( ls ); do mv $i $i.bak; done touch /etc/netplan/01_static_ip.yaml nano /etc/netplan/01_static_ip.yaml # Adapter-Einstellungen (Ctrl + O und Ctrl + X zum speichern) network: version: 2 renderer: networkd ethernets: ens18: #Edit this line according to your network interface name. dhcp4: no addresses: - 192.168.1.150/24 gateway4: 192.168.1.1 nameservers: addresses: - 8.8.8.8 - 8.8.4.4 netplan generate && netplan apply # Verbindung wird unterbrochen, Fenster schliessen # und erneut mit der neuen IP einloggen #------------------------------------------ # Hostnamen festlegen #------------------------------------------ ssh DEINUSER@192.168.1.X sudo hostnamectl set-hostname DEINHOSTNAME sudo nano /etc/hosts # Host-Datei (Ctrl + O und Ctrl + X zum speichern) 127.0.0.1 localhost 127.0.1.1 DEINHOSTNAME ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters sudo reboot #------------------------------------------ # Installation und Einstellungen #------------------------------------------ ssh DEINUSER@192.168.1.X sudo apt install proftpd-basic -y sudo systemctl enable proftpd.service sudo useradd --create-home deinftpuser --shell /bin/rbash sudo passwd deinftpuser sudo nano /etc/proftpd/proftpd.conf # FTP-Einstellungen (Ctrl + O und Ctrl + X zum speichern) # Includes DSO modules Include /etc/proftpd/modules.conf # Set off to disable IPv6 support which is annoying on IPv4 only boxes. UseIPv6 off # If set on you can experience a longer connection delay in many cases. IdentLookups off ServerName FTP-Server # Set to inetd only if you would run proftpd by inetd/xinetd/socket. ServerType standalone DeferWelcome off # Disable MultilineRFC2228 per https://github.com/proftpd/proftpd/issues/1085 # MultilineRFC2228on DefaultServer on ShowSymlinks on TimeoutNoTransfer 600 TimeoutStalled 600 TimeoutIdle 1200 DisplayLogin welcome.msg DisplayChdir .message true ListOptions -l DenyFilter \*.*/ # Use this to jail all users in their homes #DefaultRoot ~ DefaultRoot /home/deinftpuser deinftpuser # Users require a valid shell listed in /etc/shells to login. # RequireValidShelloff # Port 21 is the standard FTP port. Port 21 # Prevent DoS attacks, set the maximum number of child processes MaxInstances 5 # Set the user and group that the server normally runs at. User proftpd Group nogroup # Umask 022 is a good standard umask to prevent new files and dirs Umask 022 022 # Normally, we want files to be overwriteable. AllowOverwrite on # Log-Files TransferLog /var/log/proftpd/xferlog SystemLog /var/log/proftpd/proftpd.log # Logging onto /var/log/lastlog is enabled but set to off by default #UseLastlog on # In order to keep log file dates consistent after chroot, use timezone info. #SetEnv TZ :/etc/localtime QuotaEngine off Ratios off # Delay engine reduces impact of the so-called Timing Attack DelayEngine on ControlsEngine off ControlsMaxClients 2 ControlsLog /var/log/proftpd/controls.log ControlsInterval 5 ControlsSocket /var/run/proftpd/proftpd.sock AdminControlsEngine off # This is used for FTPS connections #Include /etc/proftpd/tls.conf # This is used for SFTP connections #Include /etc/proftpd/sftp.conf # This is used for other add-on modules #Include /etc/proftpd/dnsbl.conf #Include /etc/proftpd/geoip.conf #Include /etc/proftpd/snmp.conf # Useful to keep VirtualHost/VirtualRoot directives separated #Include /etc/proftpd/virtuals.conf # Include other custom configuration files Include /etc/proftpd/conf.d/ sudo systemctl restart proftpd.service #------------------------------------------ # Systembedienung & Wissenswertes #------------------------------------------ sudo systemctl start restart proftpd.service sudo systemctl restart proftpd.service sudo systemctl stop proftpd.service sudo nano /etc/proftpd/proftpd.conf cat /var/log/proftpd/proftpd.log cat /var/log/proftpd/xferlog sudo apt install nmap -y && nmap localhost man proftpd man proftpd.conf sudo proftpd -t $> ftp # FTP-Beispiel in der Kommandozeile ftp> open (to) 192.168.x.x Connected to 192.168.x.x 220 ProFTPD Server (FTP-Server) [192.168.x.x] Name (192.168.x.x:user): deinftpuser 331 Password required for deinftpuser Password: ******************** 230 User deinftpuser logged in Remote system type is UNIX. Using binary mode to transfer files. ftp> ls 229 Entering Extended Passive Mode (|||11820|) 150 Opening ASCII mode data connection for file list 226 Transfer complete ftp> bye 221 Goodbye.