Bonjour à tous,
Je viens de me monter un nas avec openmediavault.
mais j’ai un souci avec ProFTPD, je ne peux uploader que quelques octets avec une connexion TLS/SSL, par contre je peux télécharger les fichiers sans aucun problème depuis cette même connexion.
Je n’ai pas de problème dans les deux sens avec une connexion non TLS/SSL.
Je pense que le problème vient d’iptables, mais je ne vois pas où.
Je compte sur vous pour trouver une solution merci d’avance.
Voici le contenu de mon /etc/proftpd/proftpd.conf
[code]Include /etc/proftpd/modules.conf
UseIPv6 off
ServerName "openmediavault"
ServerType standalone
DeferWelcome off
MultilineRFC2228 on
DefaultServer on
ShowSymlinks off
DisplayLogin /home/ftp/welcome.msg
DisplayChdir .message true
ListOptions "-l"
MaxInstances 30
DenyFilter *./
AuthPAMConfig proftpd
User proftpd
Group nogroup
Umask 022 022
UseFtpUsers off
PersistentPasswd off
DefaultRoot /home/ftp
TimesGMT off
AllowOverwrite on
AuthOrder mod_auth_pam.c mod_auth_unix.c
DefaultTransferMode ascii
#TransferLog /var/log/proftpd/xferlog
#SystemLog /var/log/proftpd/proftpd.log
FACLEngine on
QuotaEngine off
Ratios off
DelayEngine on
ControlsEngine on
ControlsMaxClients 2
ControlsLog /var/log/proftpd/controls.log
ControlsInterval 5
ControlsSocket /var/run/proftpd/proftpd.sock
AdminControlsEngine off
BanEngine off
BanControlsACLs all allow user root
BanLog /var/log/proftpd/ban.log
BanMessage Host %a has been banned
BanTable /var/run/proftpd/ban.tab
Include /etc/proftpd/tls.conf
Port 21
RequireValidShell off
IdentLookups off
RequireValidShell off
IdentLookups off
UseReverseDNS off
TimeoutIdle 600
TimeoutNoTransfer 600
TimeoutStalled 600
PassivePorts 40000 40100
MasqueradeAddress IP_publique
AllowRetrieveRestart on
AllowStoreRestart on
DeleteAbortedStores off
MaxClients 10
MaxConnectionsPerHost 4
MaxLoginAttempts 3
<Directory /home/ftp>
HideFiles (welcome.msg)
<Directory /home/ftp/serveur_ftp>
AllowUser OR user_ftp
AllowGroup OR user_ftp
DenyAll
AllowUser OR user_ftp
AllowGroup OR user_ftp
DenyAll
BanEngine off
BanControlsACLs all allow user root
BanLog /var/log/proftpd/ban.log
BanMessage Host %a has been banned
BanTable /var/run/proftpd/ban.tab
celui de /etc/network/if-pre-up.d/iptables
[code]#!/bin/bash
Supprimer les règles écrites
iptables -t filter -F
iptables -t filter -X
Fermer tous les ports
iptables -t filter A INPUT -j DROP
iptables -t filter A OUTPUT -j DROP
Ne pas casser les connexions établies
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
Autorise le loopback (127.0.0.1)
iptables -t filter -A INPUT -i lo -j ACCEPT
iptables -t filter -A OUTPUT -o lo -j ACCEPT
ICMP (le ping)
iptables -t filter -A INPUT -p icmp -j ACCEPT
iptables -t filter -A OUTPUT -p icmp -j ACCEPT
DNS
iptables -t filter -A OUTPUT -p tcp --dport 53 -j ACCEPT
iptables -t filter -A OUTPUT -p udp --dport 53 -j ACCEPT
iptables -t filter -A INPUT -p tcp --dport 53 -j ACCEPT
iptables -t filter -A INPUT -p udp --dport 53 -j ACCEPT
NTP Out
iptables -t filter -A OUTPUT -p udp --dport 123 -j ACCEPT
HTTP + HTTPS Out
iptables -t filter -A OUTPUT -p tcp --dport 80 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp --dport 443 -j ACCEPT
HTTP + HTTPS In
iptables -t filter -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -t filter -A INPUT -p tcp --dport 443 -j ACCEPT
Autoriser les échanges sur le port 22 seulement depuis et vers local
iptables -t filter --src 192.168.2.0/24 -A INPUT -p TCP --dport 22 -j ACCEPT
iptables -t filter --dst 192.168.2.0/24 -A OUTPUT -p TCP --sport 22 -j ACCEPT
Serveur FTP (ftp et ftp-data)
iptables -A INPUT -p tcp --dport 20 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 20 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --dport 21 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 21 -m state --state RELATED,ESTABLISHED -j ACCEPT
FTP Passif
iptables -A INPUT -p tcp --sport 40000:40100 --dport 40000:40100 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 40000:40100 --dport 40000:40100 -m state --state ESTABLISHED,RELATED -j ACCEPT
[/code]
Log de filezilla en dl
Statut : Connexion à IP_publique:21...
Statut : Connexion établie, attente du message d'accueil...
Réponse : 220 ProFTPD 1.3.3a Server (openmediavault) [IP_publique]
Commande : AUTH TLS
Réponse : 234 AUTH TLS successful
Statut : Initialisation de TLS...
Statut : Vérification du certificat...
Commande : USER user_ftp
Statut : Connexion TLS/SSL établie.
Réponse : 331 Password required for user_ftp
Commande : PASS ******
Réponse : 230-Bienvenue sur mon ftp.
Réponse : 230 User user_ftp logged in
Commande : OPTS UTF8 ON
Réponse : 200 UTF8 set to on
Commande : PBSZ 0
Réponse : 200 PBSZ 0 successful
Commande : PROT P
Réponse : 200 Protection set to Private
Statut : Connecté
Statut : Récupération du contenu du dossier...
Commande : CWD /serveur_ftp/test1
Réponse : 250 CWD command successful
Commande : TYPE I
Réponse : 200 Type set to I
Commande : PASV
Réponse : 227 Entering Passive Mode (xx,xxx,xxx,xx,156,69).
Commande : MLSD
Réponse : 150 Opening ASCII mode data connection for MLSD
Réponse : 226 Transfer complete
Statut : Contenu du dossier affiché avec succès
Statut : Connexion à IP_publique:21...
Statut : Connexion établie, attente du message d'accueil...
Réponse : 220 ProFTPD 1.3.3a Server (openmediavault) [IP_publique]
Commande : AUTH TLS
Réponse : 234 AUTH TLS successful
Statut : Initialisation de TLS...
Statut : Vérification du certificat...
Commande : USER user_ftp
Statut : Connexion TLS/SSL établie.
Réponse : 331 Password required for user_ftp
Commande : PASS ******
Réponse : 230-Bienvenue sur mon ftp.
Réponse : 230 User user_ftp logged in
Commande : OPTS UTF8 ON
Réponse : 200 UTF8 set to on
Commande : PBSZ 0
Réponse : 200 PBSZ 0 successful
Commande : PROT P
Réponse : 200 Protection set to Private
Statut : Connecté
Statut : Démarrage du téléchargement de /serveur_ftp/FreeNAS-8.3.1-RELEASE-x86.iso
Commande : CWD /serveur_ftp
Réponse : 250 CWD command successful
Commande : PWD
Réponse : 257 "/serveur_ftp" is the current directory
Commande : TYPE I
Réponse : 200 Type set to I
Commande : PASV
Réponse : 227 Entering Passive Mode (xx,xxx,xxx,xx,156,99).
Commande : RETR FreeNAS-8.3.1-RELEASE-x86.iso
Réponse : 150 Opening BINARY mode data connection for FreeNAS-8.3.1-RELEASE-x86.iso (110800896 bytes)
Réponse : 226 Transfer complete
Statut : Transfert de fichier réussi, 105,7 Mio transférés en 5 secondes
Log de filezilla en up
Statut : Connexion à IP_publique:21...
Statut : Connexion établie, attente du message d'accueil...
Réponse : 220 ProFTPD 1.3.3a Server (openmediavault) [IP_publique]
Commande : AUTH TLS
Réponse : 234 AUTH TLS successful
Statut : Initialisation de TLS...
Statut : Vérification du certificat...
Commande : USER user_ftp
Statut : Connexion TLS/SSL établie.
Réponse : 331 Password required for user_ftp
Commande : PASS ******
Réponse : 230-Bienvenue sur mon ftp.
Réponse : 230 User user_ftp logged in
Commande : SYST
Réponse : 215 UNIX Type: L8
Commande : FEAT
Réponse : 211-Features:
Réponse : MDTM
Réponse : MFMT
Réponse : TVFS
Réponse : AUTH TLS
Réponse : UTF8
Réponse : MFF modify;UNIX.group;UNIX.mode;
Réponse : MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
Réponse : PBSZ
Réponse : PROT
Réponse : SITE MKDIR
Réponse : SITE RMDIR
Réponse : SITE UTIME
Réponse : LANG fr-FR.UTF-8;fr-FR
Réponse : SITE SYMLINK
Réponse : REST STREAM
Réponse : SIZE
Réponse : 211 End
Commande : OPTS UTF8 ON
Réponse : 200 UTF8 set to on
Commande : PBSZ 0
Réponse : 200 PBSZ 0 successful
Commande : PROT P
Réponse : 200 Protection set to Private
Statut : Connecté
Statut : Récupération du contenu du dossier...
Commande : CWD /
Réponse : 250 CWD command successful
Commande : PWD
Réponse : 257 "/" is the current directory
Commande : TYPE I
Réponse : 200 Type set to I
Commande : PASV
Réponse : 227 Entering Passive Mode (xx,xxx,xxx,xx,156,143).
Commande : MLSD
Réponse : 150 Opening ASCII mode data connection for MLSD
Réponse : 226 Transfer complete
Statut : Contenu du dossier affiché avec succès
Statut : Récupération du contenu du dossier...
Commande : CWD serveur_ftp
Réponse : 250 CWD command successful
Commande : PWD
Réponse : 257 "/serveur_ftp" is the current directory
Commande : PASV
Réponse : 227 Entering Passive Mode (xx,xxx,xxx,xx,156,65).
Commande : MLSD
Réponse : 150 Opening ASCII mode data connection for MLSD
Réponse : 226 Transfer complete
Statut : Contenu du dossier affiché avec succès
Statut : Récupération du contenu du dossier...
Commande : CWD test1
Réponse : 250 CWD command successful
Commande : PWD
Réponse : 257 "/serveur_ftp/test1" is the current directory
Commande : PASV
Réponse : 227 Entering Passive Mode (xx,xxx,xxx,xx,156,82).
Commande : MLSD
Réponse : 150 Opening ASCII mode data connection for MLSD
Réponse : 226 Transfer complete
Statut : Contenu du dossier affiché avec succès
Commande : DELE Nokia_808_PureView_lossless_zoom_demonstration_-_YouTube.flv
Réponse : 250 DELE command successful
Commande : DELE out-1.m4v
Réponse : 250 DELE command successful
Statut : Connexion à IP_publique:21...
Statut : Connexion établie, attente du message d'accueil...
Réponse : 220 ProFTPD 1.3.3a Server (openmediavault) [IP_publique]
Commande : AUTH TLS
Réponse : 234 AUTH TLS successful
Statut : Initialisation de TLS...
Statut : Vérification du certificat...
Commande : USER user_ftp
Statut : Connexion TLS/SSL établie.
Réponse : 331 Password required for user_ftp
Commande : PASS ******
Réponse : 230-Bienvenue sur mon ftp.
Réponse : 230 User user_ftp logged in
Commande : OPTS UTF8 ON
Réponse : 200 UTF8 set to on
Commande : PBSZ 0
Réponse : 200 PBSZ 0 successful
Commande : PROT P
Réponse : 200 Protection set to Private
Statut : Connecté
Statut : Démarrage de l'envoi de /media/Divers/openmediavault_0.4_i386.iso
Commande : CWD /serveur_ftp/test1
Réponse : 250 CWD command successful
Commande : PWD
Réponse : 257 "/serveur_ftp/test1" is the current directory
Commande : TYPE I
Réponse : 200 Type set to I
Commande : PASV
Réponse : 227 Entering Passive Mode (xx,xxx,xxx,xx,156,150).
Commande : STOR openmediavault_0.4_i386.iso
Réponse : 150 Opening BINARY mode data connection for openmediavault_0.4_i386.iso
Erreur : Délai d'attente expiré
Erreur : Echec du transfert du fichier après avoir transféré 224,0 Kio en 21 secondes
Statut : Connexion à IP_publique:21...
Statut : Connexion établie, attente du message d'accueil...
Réponse : 220 ProFTPD 1.3.3a Server (openmediavault) [IP_publique]
Commande : AUTH TLS
Réponse : 234 AUTH TLS successful
Statut : Initialisation de TLS...
Statut : Vérification du certificat...
Commande : USER user_ftp
Statut : Connexion TLS/SSL établie.
Réponse : 331 Password required for user_ftp
Commande : PASS ******
Réponse : 230-Bienvenue sur mon ftp.
Réponse : 230 User user_ftp logged in
Commande : OPTS UTF8 ON
Réponse : 200 UTF8 set to on
Commande : PBSZ 0
Réponse : 200 PBSZ 0 successful
Commande : PROT P
Réponse : 200 Protection set to Private
Statut : Connecté
Statut : Démarrage de l'envoi de /media/Divers/openmediavault_0.4_i386.iso
Commande : CWD /serveur_ftp/test1
Réponse : 250 CWD command successful
Statut : Récupération du contenu du dossier...
Commande : TYPE I
Réponse : 200 Type set to I
Commande : PASV
Réponse : 227 Entering Passive Mode (xx,xxx,xxx,xx,156,64).
Commande : MLSD
Réponse : 150 Opening ASCII mode data connection for MLSD
Réponse : 226 Transfer complete
Commande : PASV
Réponse : 227 Entering Passive Mode (xx,xxx,xxx,xx,156,147).
Commande : REST 884736
Réponse : 350 Restarting at 884736. Send STORE or RETRIEVE to initiate transfer
Commande : STOR openmediavault_0.4_i386.iso
Réponse : 150 Opening BINARY mode data connection for openmediavault_0.4_i386.iso
Erreur : Transfert de fichier interrompu par l'utilisateur après avoir transféré 192,0 Kio en 7 secondes
Réponse : 226 Transfer complete