Alternc  latest
Alternc logiel libre pour l'hébergement
proftpd.conf
Go to the documentation of this file.
1 #
2 # Fichier de configuration de ProFTPd pour AlternC
3 # WARNING: Do not edit this file, edit the one in /etc/alternc/templates and launch alternc.install again.
4 
5 #
6 # Includes required DSO modules. This is mandatory in proftpd 1.3
7 #
8 Include /etc/proftpd/modules.conf
9 
10 ServerName "%%hosting%%"
11 ServerIdent on "FTP Server Ready"
12 ServerType standalone
13 DeferWelcome on
14 
15 ShowSymlinks on
16 MultilineRFC2228 on
17 DefaultServer on
18 AllowOverwrite on
19 AllowStoreRestart on
20 DefaultRoot ~
21 UseReverseDNS off
22 IdentLookups off
23 UseIPv6 off
24 
25 TimeoutNoTransfer 600
26 TimeoutStalled 600
27 TimeoutIdle 1200
28 
29 DisplayLogin /etc/welcome.msg
30 # lenny-only
31 #DisplayChdir .message
32 
33 ListOptions "-al"
34 
35 DenyFilter \*.*/
36 Port 21
37 MaxInstances 30
38 User nobody
39 Group nogroup
40 RequireValidShell off
41 
42 # Use the IANA registered ephemeral port range
43 # If you have a firewall, you should open this portrange
44 # (or change it)
45 # since ip_conntrack_ftp cannot decrypt TLS session.
46 PassivePorts 50000 60000
47 
48 <Directory /*>
49  DenyAll
50 </Directory>
51 
52 <Directory %%ALTERNC_HTML%%>
53  Umask 022 022
54  AllowOverwrite on
55  AllowAll
56  <Limit SITE_CHMOD>
57  AllowAll
58  </Limit>
59 </Directory>
60 
61 MaxClientsPerHost 8 "Sorry, no more than 8 simultaneous connections"
62 AccessGrantMsg "Welcome on AlternC, %u"
63 
64 # database@host:port login password
65 SQLConnectInfo %%dbname%%@%%dbhost%%:3306 %%dbuser%% %%dbpwd%%
66 # Table :
67 SQLUserInfo ftpusers name encrypted_password uid uid homedir NULL
68 
69 # Use mysql PASSWORD function
70 SQLAuthTypes Crypt
71 # Only mysql authentication enabled
72 SQLAuthenticate users
73 AuthPAM off
74 
75 # What this SQL query do :
76 # - check if there is IP limitation for this account. If there isn't, allow everyone (by returning a TRUE)
77 # - if there is some limitation :
78 # - convert ip to integer (if convert impossible, it's an ipv6. Mysql6 will have ipv6 function, for mysql5 alternc create some function)
79 # - calculate the last IP of the subnet. If the subnet is 32, return the original IP
80 # - check that the user's ip is in an allowed range
81 # - add the IP range who are defined as "always from everyone" (uid=0. Not uid=2000, because we could want to have some limitation for the root account)
82 SQLUserWhereClause " \
83 enabled = true and \
84 true in ( \
85 select if(count(*)>0,false,(select value from variable where name='auth_ip_ftp_default_yes')) \
86 from authorised_ip_affected aia, ftpusers f \
87 where cast(aia.parameters as signed integer)=f.id and f.name='%U'\
88 UNION \
89 select \
90  ifnull(inet_aton('%h'),inet_aton6('%h')) \
91  between ifnull(inet_aton(ip),inet_aton6(ip)) \
92  and ifnull( inet_aton(ip) + if(subnet=32,0,conv( lpad('',(32-subnet),'1'), 2 , 10)) , inet_aton6(ip) + conv( lpad('',(128-subnet),'1'), 2 , 10) ) \
93 from authorised_ip ai, authorised_ip_affected aia, ftpusers f \
94 where f.name='%U' and cast(aia.parameters as signed integer)=f.id and ai.id=aia.authorised_ip_id and aia.protocol='ftp' \
95 UNION \
96 select \
97  ifnull(inet_aton('%h'),inet_aton6('%h')) \
98  between ifnull(inet_aton(ip),inet_aton6(ip)) \
99  and ifnull( inet_aton(ip) + if(subnet=32,0,conv( lpad('',(32-subnet),'1'), 2 , 10)) , inet_aton6(ip) + conv( lpad('',(128-subnet),'1'), 2 , 10) ) \
100 from authorised_ip ai \
101 where ai.uid=0 \
102 ) \
103 "
104 
105 # Uncomment this line if you want to debug Proftpd's SQL
106 #SQLLogFile /var/log/proftpd/sql.log
107 
108 # Default : www-data.www-data
109 SQLDefaultGID 33
110 SQLDefaultUID 33
111 # Minimum ID allowed to log in. Other users should use SFTP
112 SQLMinID 33
113 
114 # We don't use Unix rights managment on AlternC, so let's hide real owner/group/rights
115 DirFakeGroup on alternc
116 DirFakeUser on ~
117 
118 # Log file by default
119 SystemLog /var/log/proftpd/proftpd.log
120 TransferLog /var/log/proftpd/xferlog
121 # allow /lib or /etc /usr in chroots:
122 RLimitChroot off
123 
124 <IfModule mod_tls.c>
125  TLSEngine on
126  TLSLog /var/log/proftpd/tls.log
127  # TLSv1.3 has bugs before ProFTPd 1.3.6d and 1.3.7
128  #TLSProtocol TLSv1.2 TLSv1.3
129  TLSProtocol TLSv1.2
130  # For old clients
131  #TLSProtocol TLSv1 TLSv1.1 TLSv1.2
132 
133  # Are clients required to use FTP over TLS when talking to this server?
134  TLSRequired off
135 
136  # Server's certificate
137  TLSRSACertificateFile /etc/ssl/certs/alternc-proftpd.pem
138  TLSRSACertificateKeyFile /etc/ssl/private/alternc-proftpd.key
139 
140  # CA the server trusts
141  # TLSCACertificateFile /etc/ftpd/root.cert.pem
142 
143  # Authenticate clients that want to use FTP over TLS?
144  TLSVerifyClient off
145 
146  # Allow SSL/TLS renegotiations when the client requests them, but
147  # do not force the renegotations. Some clients do not support
148  # SSL/TLS renegotiations; when mod_tls forces a renegotiation, these
149  # clients will close the data connection, or there will be a timeout
150  # on an idle data connection.
151  TLSRenegotiate required off
152 
153  # As of ProFTPD 1.3.3rc1, mod_tls only accepts SSL/TLS data connections that reuse
154  # the SSL session of the control connection, as a security measure.
155  # Unfortunately, there are some clients (e.g. curl) which do not reuse SSL sessions.
156  # To relax the requirement that the SSL session from the control connection
157  # be reused for data connections, use the following
158  TLSOptions NoSessionReuseRequired
159 
160 </IfModule>