vsftpd安装

来源:互联网 发布:软件工程与医疗云计算 编辑:程序博客网 时间:2024/05/21 17:41

1. apt-get install vsftpd
2. 修改/etc/vsftpd.conf

  1. Example config file /etc/vsftpd.conf
    #
  2. The default compiled in settings are fairly paranoid. This sample file
  3. loosens things up a bit, to make the ftp daemon more usable.
  4. Please see vsftpd.conf.5 for all compiled in defaults.
    #
  5. READ THIS: This example file is NOT an exhaustive list of vsftpd options.
  6. Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
  7. capabilities.
    #
    #
  8. Run standalone? vsftpd can run either from an inetd or as a standalone
  9. daemon started from an initscript.
    listen=YES
    #
  10. Run standalone with IPv6?
  11. Like the listen parameter, except vsftpd will listen on an IPv6 socket
  12. instead of an IPv4 one. This parameter and the listen parameter are mutually
  13. exclusive.
    #listen_ipv6=YES
    #
  14. Allow anonymous FTP? (Beware - allowed by default if you comment this out).
    anonymous_enable=YES
    #
  15. Uncomment this to allow local users to log in.
    local_enable=YES
    #
  16. Uncomment this to enable any form of FTP write command.
    write_enable=YES
    #
  17. Default umask for local users is 077. You may wish to change this to 022,
  18. if your users expect that (022 is used by most other ftpd's)
    local_umask=022
    anon_umask=022
    #
  19. Uncomment this to allow the anonymous FTP user to upload files. This only
  20. has an effect if the above global write enable is activated. Also, you will
  21. obviously need to create a directory writable by the FTP user.
    #anon_upload_enable=YES
    #
  22. Uncomment this if you want the anonymous FTP user to be able to create
  23. new directories.
    #anon_mkdir_write_enable=YES
    #
  24. Activate directory messages - messages given to remote users when they
  25. go into a certain directory.
    dirmessage_enable=YES
    #
  26. Activate logging of uploads/downloads.
    xferlog_enable=YES
    #
  27. Make sure PORT transfer connections originate from port 20 (ftp-data).
    connect_from_port_20=YES
    #
  28. If you want, you can arrange for uploaded anonymous files to be owned by
  29. a different user. Note! Using "root" for uploaded files is not
  30. recommended!
    #chown_uploads=YES
    #chown_username=whoever
    #
  31. You may override where the log file goes if you like. The default is shown
  32. below.
    #xferlog_file=/var/log/vsftpd.log
    #
  33. If you want, you can have your log file in standard ftpd xferlog format
    #xferlog_std_format=YES
    #
  34. You may change the default value for timing out an idle session.
    #idle_session_timeout=600
    #
  35. You may change the default value for timing out a data connection.
    #data_connection_timeout=120
    #
  36. It is recommended that you define on your system a unique user which the
  37. ftp server can use as a totally isolated and unprivileged user.
    #nopriv_user=ftpsecure
    #
  38. Enable this and the server will recognise asynchronous ABOR requests. Not
  39. recommended for security (the code is non-trivial). Not enabling it,
  40. however, may confuse older FTP clients.
    #async_abor_enable=YES
    #
  41. By default the server will pretend to allow ASCII mode but in fact ignore
  42. the request. Turn on the below options to have the server actually do ASCII
  43. mangling on files when in ASCII mode.
  44. Beware that on some FTP servers, ASCII support allows a denial of service
  45. attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
  46. predicted this attack and has always been safe, reporting the size of the
  47. raw file.
  48. ASCII mangling is a horrible feature of the protocol.
    #ascii_upload_enable=YES
    #ascii_download_enable=YES
    #
  49. You may fully customise the login banner string:
    #ftpd_banner=Welcome to blah FTP service.
    #
  50. You may specify a file of disallowed anonymous e-mail addresses. Apparently
  51. useful for combatting certain DoS attacks.
    #deny_email_enable=YES
  52. (default follows)
    #banned_email_file=/etc/vsftpd.banned_emails
    #
  53. You may restrict local users to their home directories. See the FAQ for
  54. the possible risks in this before using chroot_local_user or
  55. chroot_list_enable below.
    #chroot_local_user=NO
    #
  56. You may specify an explicit list of local users to chroot() to their home
  57. directory. If chroot_local_user is YES, then this list becomes a list of
  58. users to NOT chroot().
    #chroot_list_enable=YES
  59. (default follows)
    #chroot_list_file=/etc/vsftpd.chroot_list
    #
  60. You may activate the "-R" option to the builtin ls. This is disabled by
  61. default to avoid remote users being able to cause excessive I/O on large
  62. sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
  63. the presence of the "-R" option, so there is a strong case for enabling it.
    #ls_recurse_enable=YES
    #
    #
  64. Debian customization
    #
  65. Some of vsftpd's settings don't fit the Debian filesystem layout by
  66. default. These settings are more Debian-friendly.
    #
  67. This option should be the name of a directory which is empty. Also, the
  68. directory should not be writable by the ftp user. This directory is used
  69. as a secure chroot() jail at times vsftpd does not require filesystem
  70. access.
    secure_chroot_dir=/var/run/vsftpd
    #
  71. This string is the name of the PAM service vsftpd will use.
    pam_service_name=vsftpd
    #
  72. This option specifies the location of the RSA certificate to use for SSL
  73. encrypted connections.
    rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
  74. This option specifies the location of the RSA key to use for SSL
  75. encrypted connections.
    rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key

#guest_enable=YES
#guest_username=hipi_ftp
user_config_dir=/etc/vsftpd_user_conf
pam_service_name=vsftpd.vu
local_enable=YES
#local_root=/u01/HIPI-Server/src

3. 重启 /etc/init.d/vsftpd restart

原创粉丝点击