Salut!
Reprenons dans l'ordre parce que c'est assez complex mine de rien!!
Concernant juste le FTP voici mon fichier de config vsftpd.conf:
ftpd_banner=Welcome to RJC FTP service.
#L'anonnyme
anonymous_enable=no
anon_upload_enable=no
anon_mkdir_write_enable=no
anon_other_write_enable=no
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
#Sécurité
userlist_enable=YES
userlist_file=/etc/vsftpd/vsftpd_user.deny
chroot_list_enable=yes
chroot_local_user=no
chroot_list_file=/etc/vsftpd/vsftpd.chroot_list
ls_recurse_enable=no
guest_enable=no
#Caractéristiques
#ascii_upload_enable=no
#ascii_download_enable=YES
listen=YES
tcp_wrappers=YES
chown_uploads=no
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
#max_client=10
pam_service_name=vsftpd
#pasv_max_port = 61000
#pasv_min_port = 60000
#pasv_enable = yes
#Performance
one_process_model=no
idle_session_timeout=120
connect_timeout=60
Déja il y a un problème car lorsque j'active les fonctions liées au mode passif et que je relance le ftp jai ce message:
vsftpd est mort mais subsys est vérouillé.
Le testparm me dit que tout est bien!
Je travail sur une redhat V9
Puis miracle pour l'instant quelques utilisateurs arrivent à se connecter. (mais pas tous pb de mode actif ou passif j pense)
J'ai mis tes conseils en application.
le lsmod me donne:
root@RJCIPCOP:~ # lsmod
Module Size Used by Not tainted
ipt_MASQUERADE 1336 1 (autoclean)
ipt_TCPMSS 2456 1 (autoclean)
ipt_state 664 14 (autoclean)
ipt_REJECT 3288 1 (autoclean)
ipt_LOG 3808 9 (autoclean)
ipt_limit 952 10 (autoclean)
iptable_mangle 2256 0 (autoclean) (unused)
iptable_filter 1764 1 (autoclean)
8139too 13096 3
mii 2304 0 [8139too]
crc32 2848 0 [8139too]
usb-uhci 21036 0 (unused)
ip_nat_quake3 2024 0 (unused)
ip_conntrack_quake3 2056 1
ip_nat_proto_gre 1412 0 (unused)
ip_nat_pptp 2412 0 (unused)
ip_conntrack_pptp 2960 1
ip_conntrack_proto_gre 2196 0 [ip_nat_pptp ip_conntrack_pptp]
ip_nat_mms 3056 0 (unused)
ip_conntrack_mms 3312 1
ip_nat_irc 2544 0 (unused)
ip_conntrack_irc 3184 1
ip_nat_h323 2700 0 (unused)
ip_conntrack_h323 2320 1
ip_nat_ftp 3248 0 (unused)
ip_conntrack_ftp 3888 1
iptable_nat 16664 8 [ipt_MASQUERADE ip_nat_quake3 ip_nat_proto_gre ip_nat_pptp ip_nat_mms ip_nat_irc ip_nat_h323 ip_nat_ftp]
ip_conntrack 19948 7 [ipt_MASQUERADE ipt_state ip_nat_quake3 ip_conntrack_quake3 ip_nat_pptp ip_conntrack_pptp ip_conntrack_proto_gre ip_nat_mms ip_conntrack_mms ip_nat_irc ip_conntrack_irc ip_nat_h323 ip_conntrack_h323 ip_nat_ftp ip_conntrack_ftp iptable_nat]
ip_tables 11576 11 [ipt_MASQUERADE ipt_TCPMSS ipt_state ipt_REJECT ipt_LOG ipt_limit iptable_mangle iptable_filter iptable_nat]
acm 5120 0 (unused)
keybdev 1792 0 (unused)
hid 22756 0 (unused)
input 3360 0 [keybdev hid]
sd_mod 10444 0 (unused)
usb-storage 24088 0 (unused)
scsi_mod 55488 1 [sd_mod usb-storage]
usbcore 56768 1 [usb-uhci acm hid usb-storage]
apm 9088 0
root@RJCIPCOP:~ #
iptables -L me donne:
Chain INPUT (policy DROP)
target prot opt source destination
ipac~o all -- anywhere anywhere
BADTCP all -- anywhere anywhere
tcp -- anywhere anywhere tcp flags:SYN,RST,ACK/SYN limit: avg 10/sec burst 5
CUSTOMINPUT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere icmp echo-request
ACCEPT all -- anywhere anywhere state NEW
DROP all -- 127.0.0.0/8 anywhere state NEW
DROP all -- anywhere 127.0.0.0/8 state NEW
ACCEPT !icmp -- anywhere anywhere state NEW
ACCEPT all -- anywhere anywhere
DHCPBLUEINPUT all -- anywhere anywhere
IPSECRED all -- anywhere anywhere
IPSECBLUE all -- anywhere anywhere
WIRELESSINPUT all -- anywhere anywhere
REDINPUT all -- anywhere anywhere
XTACCESS all -- anywhere anywhere state NEW
LOG all -- anywhere anywhere limit: avg 10/min burst 5 LOG level warning prefix `INPUT '
Chain FORWARD (policy DROP)
target prot opt source destination
ipac~fi all -- anywhere anywhere
ipac~fo all -- anywhere anywhere
BADTCP all -- anywhere anywhere
TCPMSS tcp -- anywhere anywhere tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
CUSTOMFORWARD all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere state NEW
DROP all -- 127.0.0.0/8 anywhere state NEW
DROP all -- anywhere 127.0.0.0/8 state NEW
ACCEPT all -- anywhere anywhere state NEW
ACCEPT all -- anywhere anywhere
WIRELESSFORWARD all -- anywhere anywhere
REDFORWARD all -- anywhere anywhere
DMZHOLES all -- anywhere anywhere state NEW
PORTFWACCESS all -- anywhere anywhere state NEW
LOG all -- anywhere anywhere limit: avg 10/min burst 5 LOG level warning prefix `OUTPUT '
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ipac~i all -- anywhere anywhere
CUSTOMOUTPUT all -- anywhere anywhere
Chain BADTCP (2 references)
target prot opt source destination
PSCAN tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,PSH,ACK,URG/FIN,PSH,URG
PSCAN tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,PSH,ACK,URG/NONE
PSCAN tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,PSH,ACK,URG/FIN
PSCAN tcp -- anywhere anywhere tcp flags:SYN,RST/SYN,RST
PSCAN tcp -- anywhere anywhere tcp flags:FIN,SYN/FIN,SYN
NEWNOTSYN tcp -- anywhere anywhere tcp flags:!SYN,RST,ACK/SYN state NEW
Chain CUSTOMFORWARD (1 references)
target prot opt source destination
Chain CUSTOMINPUT (1 references)
target prot opt source destination
Chain CUSTOMOUTPUT (1 references)
target prot opt source destination
Chain DHCPBLUEINPUT (1 references)
target prot opt source destination
Chain DMZHOLES (1 references)
target prot opt source destination
Chain IPSECBLUE (1 references)
target prot opt source destination
Chain IPSECRED (1 references)
target prot opt source destination
Chain LOG_DROP (0 references)
target prot opt source destination
LOG all -- anywhere anywhere limit: avg 10/min burst 5 LOG level warning
DROP all -- anywhere anywhere
Chain LOG_REJECT (0 references)
target prot opt source destination
LOG all -- anywhere anywhere limit: avg 10/min burst 5 LOG level warning
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
Chain NEWNOTSYN (1 references)
target prot opt source destination
LOG all -- anywhere anywhere limit: avg 10/min burst 5 LOG level warning prefix `NEW not SYN? '
DROP all -- anywhere anywhere
Chain PORTFWACCESS (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere 192.168.2.2 tcp dpt:ftp-data
ACCEPT tcp -- anywhere 192.168.2.2 tcp dpt:ftp
ACCEPT tcp -- anywhere 192.168.2.2 tcp dpts:60000:61000
Chain PSCAN (5 references)
target prot opt source destination
LOG tcp -- anywhere anywhere limit: avg 10/min burst 5 LOG level warning prefix `TCP Scan? '
LOG udp -- anywhere anywhere limit: avg 10/min burst 5 LOG level warning prefix `UDP Scan? '
LOG icmp -- anywhere anywhere limit: avg 10/min burst 5 LOG level warning prefix `ICMP Scan? '
LOG all -f anywhere anywhere limit: avg 10/min burst 5 LOG level warning prefix `FRAG Scan? '
DROP all -- anywhere anywhere
Chain REDFORWARD (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere
ACCEPT udp -- anywhere anywhere
Chain REDINPUT (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp spt:bootps dpt:bootpc
ACCEPT udp -- anywhere anywhere udp spt:bootps dpt:bootpc
Chain WIRELESSFORWARD (1 references)
target prot opt source destination
Chain WIRELESSINPUT (1 references)
target prot opt source destination
Chain XTACCESS (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere lns-vlq-33-xxx-82-xxx-xxx-140.adsl.proxad.net tcp dpt:ident
Chain ipac~fi (1 references)
target prot opt source destination
all -- anywhere anywhere
all -- anywhere anywhere
all -- anywhere anywhere
Chain ipac~fo (1 references)
target prot opt source destination
all -- anywhere anywhere
all -- anywhere anywhere
all -- anywhere anywhere
Chain ipac~i (1 references)
target prot opt source destination
all -- anywhere anywhere
all -- anywhere anywhere
all -- anywhere anywhere
Chain ipac~o (1 references)
target prot opt source destination
all -- anywhere anywhere
all -- anywhere anywhere
all -- anywhere anywhere
et enfin iptables -t nat -L
Chain INPUT (policy DROP)
target prot opt source destination
ipac~o all -- anywhere anywhere
BADTCP all -- anywhere anywhere
tcp -- anywhere anywhere tcp flags:SYN,RST,A
CK/SYN limit: avg 10/sec burst 5
CUSTOMINPUT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTAB
LISHED
ACCEPT icmp -- anywhere anywhere icmp echo-request
ACCEPT all -- anywhere anywhere state NEW
DROP all -- 127.0.0.0/8 anywhere state NEW
DROP all -- anywhere 127.0.0.0/8 state NEW
ACCEPT !icmp -- anywhere anywhere state NEW
ACCEPT all -- anywhere anywhere
DHCPBLUEINPUT all -- anywhere anywhere
IPSECRED all -- anywhere anywhere
IPSECBLUE all -- anywhere anywhere
WIRELESSINPUT all -- anywhere anywhere
REDINPUT all -- anywhere anywhere
XTACCESS all -- anywhere anywhere state NEW
LOG all -- anywhere anywhere limit: avg 10/min b
urst 5 LOG level warning prefix `INPUT '
Chain FORWARD (policy DROP)
target prot opt source destination
ipac~fi all -- anywhere anywhere
ipac~fo all -- anywhere anywhere
BADTCP all -- anywhere anywhere
TCPMSS tcp -- anywhere anywhere tcp flags:SYN,RST/S
YN TCPMSS clamp to PMTU
CUSTOMFORWARD all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTAB
LISHED
ACCEPT all -- anywhere anywhere state NEW
DROP all -- 127.0.0.0/8 anywhere state NEW
DROP all -- anywhere 127.0.0.0/8 state NEW
ACCEPT all -- anywhere anywhere state NEW
ACCEPT all -- anywhere anywhere
WIRELESSFORWARD all -- anywhere anywhere
REDFORWARD all -- anywhere anywhere
DMZHOLES all -- anywhere anywhere state NEW
PORTFWACCESS all -- anywhere anywhere state NEW
LOG all -- anywhere anywhere limit: avg 10/min b
urst 5 LOG level warning prefix `OUTPUT '
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ipac~i all -- anywhere anywhere
CUSTOMOUTPUT all -- anywhere anywhere
Chain BADTCP (2 references)
target prot opt source destination
PSCAN tcp -- anywhere anywhere tcp flags:FIN,SYN,R
ST,PSH,ACK,URG/FIN,PSH,URG
PSCAN tcp -- anywhere anywhere tcp flags:FIN,SYN,R
ST,PSH,ACK,URG/NONE
PSCAN tcp -- anywhere anywhere tcp flags:FIN,SYN,R
ST,PSH,ACK,URG/FIN
PSCAN tcp -- anywhere anywhere tcp flags:SYN,RST/S
YN,RST
PSCAN tcp -- anywhere anywhere tcp flags:FIN,SYN/F
IN,SYN
NEWNOTSYN tcp -- anywhere anywhere tcp flags:!SYN,RST,
ACK/SYN state NEW
Chain CUSTOMFORWARD (1 references)
target prot opt source destination
Chain CUSTOMINPUT (1 references)
target prot opt source destination
Chain CUSTOMOUTPUT (1 references)
target prot opt source destination
Chain DHCPBLUEINPUT (1 references)
target prot opt source destination
Chain DMZHOLES (1 references)
target prot opt source destination
Chain IPSECBLUE (1 references)
target prot opt source destination
Chain IPSECRED (1 references)
target prot opt source destination
Chain LOG_DROP (0 references)
target prot opt source destination
LOG all -- anywhere anywhere limit: avg 10/min b
urst 5 LOG level warning
DROP all -- anywhere anywhere
Chain LOG_REJECT (0 references)
target prot opt source destination
LOG all -- anywhere anywhere limit: avg 10/min b
urst 5 LOG level warning
REJECT all -- anywhere anywhere reject-with icmp-po
rt-unreachable
Chain NEWNOTSYN (1 references)
target prot opt source destination
LOG all -- anywhere anywhere limit: avg 10/min b
urst 5 LOG level warning prefix `NEW not SYN? '
DROP all -- anywhere anywhere
Chain PORTFWACCESS (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere 192.168.2.2 tcp dpt:ftp-data
ACCEPT tcp -- anywhere 192.168.2.2 tcp dpt:ftp
ACCEPT tcp -- anywhere 192.168.2.2 tcp dpts:60000:6100
0
Chain PSCAN (5 references)
target prot opt source destination
LOG tcp -- anywhere anywhere limit: avg 10/min b
urst 5 LOG level warning prefix `TCP Scan? '
LOG udp -- anywhere anywhere limit: avg 10/min b
urst 5 LOG level warning prefix `UDP Scan? '
LOG icmp -- anywhere anywhere limit: avg 10/min b
urst 5 LOG level warning prefix `ICMP Scan? '
LOG all -f anywhere anywhere limit: avg 10/min b
urst 5 LOG level warning prefix `FRAG Scan? '
DROP all -- anywhere anywhere
Chain REDFORWARD (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere
ACCEPT udp -- anywhere anywhere
Chain REDINPUT (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp spt:bootps dpt:
bootpc
ACCEPT udp -- anywhere anywhere udp spt:bootps dpt:
bootpc
Chain WIRELESSFORWARD (1 references)
target prot opt source destination
Chain WIRELESSINPUT (1 references)
target prot opt source destination
Chain XTACCESS (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere lns-vlq-33-xxx-82-xxx-xxx-140.adsl.prox
ad.net tcp dpt:ident
Chain ipac~fi (1 references)
target prot opt source destination
all -- anywhere anywhere
all -- anywhere anywhere
all -- anywhere anywhere
Chain ipac~fo (1 references)
target prot opt source destination
all -- anywhere anywhere
all -- anywhere anywhere
all -- anywhere anywhere
Chain ipac~i (1 references)
target prot opt source destination
all -- anywhere anywhere
all -- anywhere anywhere
all -- anywhere anywhere
Chain ipac~o (1 references)
target prot opt source destination
all -- anywhere anywhere
all -- anywhere anywhere
all -- anywhere anywhere
root@RJCIPCOP:~ #
root@RJCIPCOP:~ # iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
CUSTOMPREROUTING all -- anywhere anywhere
SQUID all -- anywhere anywhere
PORTFW all -- anywhere anywhere
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
CUSTOMPOSTROUTING all -- anywhere anywhere
REDNAT all -- anywhere anywhere
POSTPORTFW all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain CUSTOMPOSTROUTING (1 references)
target prot opt source destination
Chain CUSTOMPREROUTING (1 references)
target prot opt source destination
Chain PORTFW (1 references)
target prot opt source destination
DNAT tcp -- anywhere lns-vlq-33-xxx-82-xxx-xxx-140.adsl.prox
ad.net tcp dpt:ftp-data to:192.168.2.2:20
DNAT tcp -- anywhere lns-vlq-33-xxx-82-xxx-xxx-140.adsl.prox
ad.net tcp dpt:ftp to:192.168.2.2:21
DNAT tcp -- anywhere lns-vlq-33-xxx-82-xxx-xxx-140.adsl.prox
ad.net tcp dpts:60000:61000 to:192.168.2.2:60000-61000
Chain POSTPORTFW (1 references)
target prot opt source destination
SNAT tcp -- 192.168.1.0/24 192.168.2.2 tcp dpt:ftp-data to
:192.168.1.1
SNAT tcp -- 192.168.1.0/24 192.168.2.2 tcp dpt:ftp to:192.
168.1.1
SNAT tcp -- 192.168.1.0/24 192.168.2.2 tcp dpts:60000:6100
0 to:192.168.1.1
Chain REDNAT (1 references)
target prot opt source destination
MASQUERADE all -- anywhere anywhere
Chain SQUID (1 references)
target prot opt source destination
Merci bcp de ton aide. si tu arrives a trouver bon courage.
dailleurs, j'ai posé la question sur d'autres forum et personne dit la meme chose. il est dit (mais est ce vrai) qu'avec le principe des iptables il y a juste a faire un transfert de port (20 et 21) et c'est bon.J'ai essayé mais cela ne marche pas tt le tps pour le client qui se connect.
Merci
A si une autre question:
Je voudrais que certains users puissent juste upload et download . (aucunes modif possible comme effacer des fichiers)
Les users sont bloqués dans leurs rep perso.J'ai essayé de changer les permissions de leur rep perso mais si j'autorise juste la lecture impossible de download.
Merci.