Advertisement
Guest User

proftpd issue

a guest
Apr 30th, 2014
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.80 KB | None | 0 0
  1.  
  2. # This is the ProFTPD configuration file
  3. #
  4. # See: http://www.proftpd.org/docs/directives/linked/by-name.html
  5.  
  6. # Server Config - config used for anything outside a <VirtualHost> or <Global> context
  7. # See: http://www.proftpd.org/docs/howto/Vhost.html
  8.  
  9. ServerName "My Server"
  10. ServerIdent on "Welcome to My FTP."
  11. ServerAdmin my@email.com
  12. DefaultServer on
  13. ServerType standalone
  14.  
  15. # Cause every FTP user except adm to be chrooted into their home directory
  16. # Aliasing /etc/security/pam_env.conf into the chroot allows pam_env to
  17. # work at session-end time (http://bugzilla.redhat.com/477120)
  18. VRootEngine on
  19. DefaultRoot /srv/protected
  20. VRootAlias /etc/security/pam_env.conf etc/security/pam_env.conf
  21.  
  22. # Use pam to authenticate (default) and be authoritative
  23. AuthPAMConfig proftpd
  24. AuthOrder mod_auth_pam.c* mod_auth_unix.c
  25. # If you use NIS/YP/LDAP you may need to disable PersistentPasswd
  26. #PersistentPasswd off
  27.  
  28. # Don't do reverse DNS lookups (hangs on DNS problems)
  29. UseReverseDNS off
  30.  
  31. # Set the user and group that the server runs as
  32. User apache
  33. Group apache
  34.  
  35. # To prevent DoS attacks, set the maximum number of child processes
  36. # to 20. If you need to allow more than 20 concurrent connections
  37. # at once, simply increase this value. Note that this ONLY works
  38. # in standalone mode; in inetd mode you should use an inetd server
  39. # that allows you to limit maximum number of processes per service
  40. # (such as xinetd)
  41. MaxInstances 20
  42.  
  43. # Disable sendfile by default since it breaks displaying the download speeds in
  44. # ftptop and ftpwho
  45. UseSendfile off
  46.  
  47. # Define the log formats
  48. LogFormat default "%h %l %u %t \"%r\" %s %b"
  49. LogFormat auth "%v [%P] %h %t \"%r\" %s"
  50.  
  51. # Dynamic Shared Object (DSO) loading
  52. # See README.DSO and howto/DSO.html for more details
  53. #
  54. # General database support (http://www.proftpd.org/docs/contrib/mod_sql.html)
  55. # LoadModule mod_sql.c
  56. #
  57. # Support for base-64 or hex encoded MD5 and SHA1 passwords from SQL tables
  58. # (contrib/mod_sql_passwd.html)
  59. # LoadModule mod_sql_passwd.c
  60. #
  61. # Mysql support (requires proftpd-mysql package)
  62. # (http://www.proftpd.org/docs/contrib/mod_sql.html)
  63. # LoadModule mod_sql_mysql.c
  64. #
  65. # Postgresql support (requires proftpd-postgresql package)
  66. # (http://www.proftpd.org/docs/contrib/mod_sql.html)
  67. # LoadModule mod_sql_postgres.c
  68. #
  69. # Quota support (http://www.proftpd.org/docs/contrib/mod_quotatab.html)
  70. # LoadModule mod_quotatab.c
  71. #
  72. # File-specific "driver" for storing quota table information in files
  73. # (http://www.proftpd.org/docs/contrib/mod_quotatab_file.html)
  74. # LoadModule mod_quotatab_file.c
  75. #
  76. # SQL database "driver" for storing quota table information in SQL tables
  77. # (http://www.proftpd.org/docs/contrib/mod_quotatab_sql.html)
  78. # LoadModule mod_quotatab_sql.c
  79. #
  80. # LDAP support (requires proftpd-ldap package)
  81. # (http://www.proftpd.org/docs/directives/linked/config_ref_mod_ldap.html)
  82. # LoadModule mod_ldap.c
  83. #
  84. # LDAP quota support (requires proftpd-ldap package)
  85. # (http://www.proftpd.org/docs/contrib/mod_quotatab_ldap.html)
  86. # LoadModule mod_quotatab_ldap.c
  87. #
  88. # Support for authenticating users using the RADIUS protocol
  89. # (http://www.proftpd.org/docs/contrib/mod_radius.html)
  90. # LoadModule mod_radius.c
  91. #
  92. # Retrieve quota limit table information from a RADIUS server
  93. # (http://www.proftpd.org/docs/contrib/mod_quotatab_radius.html)
  94. # LoadModule mod_quotatab_radius.c
  95. #
  96. # Administrative control actions for the ftpdctl program
  97. # (http://www.proftpd.org/docs/contrib/mod_ctrls_admin.html)
  98. # LoadModule mod_ctrls_admin.c
  99. #
  100. # Execute external programs or scripts at various points in the process
  101. # of handling FTP commands
  102. # (http://www.castaglia.org/proftpd/modules/mod_exec.html)
  103. # LoadModule mod_exec.c
  104. #
  105. # Support for POSIX ACLs
  106. # (http://www.proftpd.org/docs/modules/mod_facl.html)
  107. # LoadModule mod_facl.c
  108. #
  109. # Support for using the GeoIP library to look up geographical information on
  110. # the connecting client and using that to set access controls for the server
  111. # (http://www.castaglia.org/proftpd/modules/mod_geoip.html)
  112. # LoadModule mod_geoip.c
  113. #
  114. # Configure server availability based on system load
  115. # (http://www.proftpd.org/docs/contrib/mod_load.html)
  116. # LoadModule mod_load.c
  117. #
  118. # Limit downloads to a multiple of upload volume (see README.ratio)
  119. # LoadModule mod_ratio.c
  120. #
  121. # Rewrite FTP commands sent by clients on-the-fly,
  122. # using regular expression matching and substitution
  123. # (http://www.proftpd.org/docs/contrib/mod_rewrite.html)
  124. # LoadModule mod_rewrite.c
  125. #
  126. # Support for the SSH2, SFTP, and SCP protocols, for secure file transfer over
  127. # an SSH2 connection (http://www.castaglia.org/proftpd/modules/mod_sftp.html)
  128. # LoadModule mod_sftp.c
  129. #
  130. # Use PAM to provide a 'keyboard-interactive' SSH2 authentication method for
  131. # mod_sftp (http://www.castaglia.org/proftpd/modules/mod_sftp_pam.html)
  132. # LoadModule mod_sftp_pam.c
  133. #
  134. # Use SQL (via mod_sql) for looking up authorized SSH2 public keys for user
  135. # and host based authentication
  136. # (http://www.castaglia.org/proftpd/modules/mod_sftp_sql.html)
  137. # LoadModule mod_sftp_sql.c
  138. #
  139. # Provide data transfer rate "shaping" across the entire server
  140. # (http://www.castaglia.org/proftpd/modules/mod_shaper.html)
  141. # LoadModule mod_shaper.c
  142. #
  143. # Support for miscellaneous SITE commands such as SITE MKDIR, SITE SYMLINK,
  144. # and SITE UTIME (http://www.proftpd.org/docs/contrib/mod_site_misc.html)
  145. # LoadModule mod_site_misc.c
  146. #
  147. # Provide an external SSL session cache using shared memory
  148. # (contrib/mod_tls_shmcache.html)
  149. # LoadModule mod_tls_shmcache.c
  150. #
  151. # Use the /etc/hosts.allow and /etc/hosts.deny files, or other allow/deny
  152. # files, for IP-based access control
  153. # (http://www.proftpd.org/docs/contrib/mod_wrap.html)
  154. # LoadModule mod_wrap.c
  155. #
  156. # Use the /etc/hosts.allow and /etc/hosts.deny files, or other allow/deny
  157. # files, as well as SQL-based access rules, for IP-based access control
  158. # (http://www.proftpd.org/docs/contrib/mod_wrap2.html)
  159. # LoadModule mod_wrap2.c
  160. #
  161. # Support module for mod_wrap2 that handles access rules stored in specially
  162. # formatted files on disk
  163. # (http://www.proftpd.org/docs/contrib/mod_wrap2_file.html)
  164. # LoadModule mod_wrap2_file.c
  165. #
  166. # Support module for mod_wrap2 that handles access rules stored in SQL
  167. # database tables (http://www.proftpd.org/docs/contrib/mod_wrap2_sql.html)
  168. # LoadModule mod_wrap2_sql.c
  169. #
  170. # Provide a flexible way of specifying that certain configuration directives
  171. # only apply to certain sessions, based on credentials such as connection
  172. # class, user, or group membership
  173. # (http://www.proftpd.org/docs/contrib/mod_ifsession.html)
  174. # LoadModule mod_ifsession.c
  175.  
  176. # TLS (http://www.castaglia.org/proftpd/modules/mod_tls.html)
  177. <IfDefine TLS>
  178. TLSEngine on
  179. TLSRequired on
  180. TLSRSACertificateFile /etc/pki/tls/certs/proftpd.pem
  181. TLSRSACertificateKeyFile /etc/pki/tls/certs/proftpd.pem
  182. TLSCipherSuite ALL:!ADH:!DES
  183. TLSOptions NoCertRequest
  184. TLSVerifyClient off
  185. #TLSRenegotiate ctrl 3600 data 512000 required off timeout 300
  186. TLSLog /var/log/proftpd/tls.log
  187. <IfModule mod_tls_shmcache.c>
  188. TLSSessionCache shm:/file=/var/run/proftpd/sesscache
  189. </IfModule>
  190. </IfDefine>
  191.  
  192. # Dynamic ban lists (http://www.proftpd.org/docs/contrib/mod_ban.html)
  193. # Enable this with PROFTPD_OPTIONS=-DDYNAMIC_BAN_LISTS in /etc/sysconfig/proftpd
  194. <IfDefine DYNAMIC_BAN_LISTS>
  195. LoadModule mod_ban.c
  196. BanEngine on
  197. BanLog /var/log/proftpd/ban.log
  198. BanTable /var/run/proftpd/ban.tab
  199.  
  200. # If the same client reaches the MaxLoginAttempts limit 2 times
  201. # within 10 minutes, automatically add a ban for that client that
  202. # will expire after one hour.
  203. BanOnEvent MaxLoginAttempts 2/00:10:00 01:00:00
  204.  
  205. # Allow the FTP admin to manually add/remove bans
  206. BanControlsACLs all allow user ftpadm
  207. </IfDefine>
  208.  
  209. # Global Config - config common to Server Config and all virtual hosts
  210. # See: http://www.proftpd.org/docs/howto/Vhost.html
  211. <Global>
  212.  
  213. # Umask 022 is a good standard umask to prevent new dirs and files
  214. # from being group and world writable
  215. Umask 022
  216.  
  217. # Allow users to overwrite files and change permissions
  218. AllowOverwrite yes
  219. <Limit ALL SITE_CHMOD>
  220. AllowAll
  221. </Limit>
  222.  
  223. </Global>
  224.  
  225. # A basic anonymous configuration, with an upload directory
  226. # Enable this with PROFTPD_OPTIONS=-DANONYMOUS_FTP in /etc/sysconfig/proftpd
  227. <IfDefine ANONYMOUS_FTP>
  228. <Anonymous ~ftp>
  229. User ftp
  230. Group ftp
  231. AccessGrantMsg "Anonymous login ok, restrictions apply."
  232.  
  233. # We want clients to be able to login with "anonymous" as well as "ftp"
  234. UserAlias anonymous ftp
  235.  
  236. # Limit the maximum number of anonymous logins
  237. MaxClients 10 "Sorry, max %m users -- try again later"
  238.  
  239. # Put the user into /pub right after login
  240. #DefaultChdir /pub
  241.  
  242. # We want 'welcome.msg' displayed at login, '.message' displayed in
  243. # each newly chdired directory and tell users to read README* files.
  244. DisplayLogin /welcome.msg
  245. DisplayChdir .message
  246. DisplayReadme README*
  247.  
  248. # Cosmetic option to make all files appear to be owned by user "ftp"
  249. DirFakeUser on ftp
  250. DirFakeGroup on ftp
  251.  
  252. # Limit WRITE everywhere in the anonymous chroot
  253. <Limit WRITE SITE_CHMOD>
  254. DenyAll
  255. </Limit>
  256.  
  257. # An upload directory that allows storing files but not retrieving
  258. # or creating directories.
  259. <Directory uploads/*>
  260. AllowOverwrite no
  261. <Limit READ>
  262. DenyAll
  263. </Limit>
  264.  
  265. <Limit STOR>
  266. AllowAll
  267. </Limit>
  268. </Directory>
  269.  
  270. # Don't write anonymous accesses to the system wtmp file (good idea!)
  271. WtmpLog off
  272.  
  273. # Logging for the anonymous transfers
  274. ExtendedLog /var/log/proftpd/access.log WRITE,READ default
  275. ExtendedLog /var/log/proftpd/auth.log AUTH auth
  276.  
  277. </Anonymous>
  278. </IfDefine>
  279.  
  280. PassivePorts 50000 51000
  281.  
  282. <IfModule mod_cap.c>
  283. CapabilitiesEngine on
  284. CapabilitiesSet +CAP_CHOWN
  285. </IfModule>
  286.  
  287. <Directory /srv/protected>
  288. UserOwner apache
  289. GroupOwner apache
  290. </Directory>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement