Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.50 KB | None | 0 0
  1. [root@HOst ~]# cat /etc/vsftpd/vsftpd.conf
  2. # Example config file /etc/vsftpd/vsftpd.conf
  3. #
  4. # The default compiled in settings are fairly paranoid. This sample file
  5. # loosens things up a bit, to make the ftp daemon more usable.
  6. # Please see vsftpd.conf.5 for all compiled in defaults.
  7. #
  8. # READ THIS: This example file is NOT an exhaustive list of vsftpd options.
  9. # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
  10. # capabilities.
  11. #listen_ipv6=YES
  12. #
  13. # Allow anonymous FTP? (Beware - allowed by default if you comment this out).
  14. anonymous_enable=YES
  15. #
  16. # Uncomment this to allow local users to log in.
  17. local_enable=YES
  18. #
  19. # Uncomment this to enable any form of FTP write command.
  20. write_enable=YES
  21. #
  22. # Default umask for local users is 077. You may wish to change this to 022,
  23. # if your users expect that (022 is used by most other ftpd's)
  24. #local_umask=077
  25. #
  26. # Uncomment this to allow the anonymous FTP user to upload files. This only
  27. # has an effect if the above global write enable is activated. Also, you will
  28. # obviously need to create a directory writable by the FTP user.
  29. anon_upload_enable=YES
  30. #
  31. # Uncomment this if you want the anonymous FTP user to be able to create
  32. # new directories.
  33. anon_mkdir_write_enable=YES
  34. #
  35. # Activate directory messages - messages given to remote users when they
  36. # go into a certain directory.
  37. dirmessage_enable=YES
  38. use_localtime=YES
  39. # The target log file can be vsftpd_log_file or xferlog_file.
  40. # This depends on setting xferlog_std_format parameter
  41. xferlog_enable=YES
  42. #
  43. # Make sure PORT transfer connections originate from port 20 (ftp-data).
  44. connect_from_port_20=YES
  45. #
  46. # If you want, you can arrange for uploaded anonymous files to be owned by
  47. # a different user. Note! Using "root" for uploaded files is not
  48. # recommended!
  49. chown_uploads=YES
  50. chown_username=ftp
  51. #
  52. # The name of log file when xferlog_enable=YES and xferlog_std_format=YES
  53. # WARNING - changing this filename affects /etc/logrotate.d/vsftpd.log
  54. #xferlog_file=/var/log/xferlog
  55. #
  56. # Switches between logging into vsftpd_log_file and xferlog_file files.
  57. # NO writes to vsftpd_log_file, YES to xferlog_file
  58. #xferlog_std_format=YES
  59. #
  60. # You may change the default value for timing out an idle session.
  61. #idle_session_timeout=600
  62. #
  63. # You may change the default value for timing out a data connection.
  64. #data_connection_timeout=120
  65. #
  66. # It is recommended that you define on your system a unique user which the
  67. # ftp server can use as a totally isolated and unprivileged user.
  68. #nopriv_user=ftpsecure
  69. #
  70. # Enable this and the server will recognise asynchronous ABOR requests. Not
  71. # recommended for security (the code is non-trivial). Not enabling it,
  72. # however, may confuse older FTP clients.
  73. #async_abor_enable=YES
  74. #
  75. # By default the server will pretend to allow ASCII mode but in fact ignore
  76. # the request. Turn on the below options to have the server actually do ASCII
  77. # mangling on files when in ASCII mode.
  78. # Beware that on some FTP servers, ASCII support allows a denial of service
  79. # attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
  80. # predicted this attack and has always been safe, reporting the size of the
  81. # raw file.
  82. # ASCII mangling is a horrible feature of the protocol.
  83. #ascii_upload_enable=YES
  84. #ascii_download_enable=YES
  85. #
  86. # You may fully customise the login banner string:
  87. ftpd_banner=Welcome to blah FTP service.
  88. #
  89. # You may specify a file of disallowed anonymous e-mail addresses. Apparently
  90. # useful for combatting certain DoS attacks.
  91. #deny_email_enable=YES
  92. # (default follows)
  93. #banned_email_file=/etc/vsftpd/banned_emails
  94. #
  95. # You may specify an explicit list of local users to chroot() to their home
  96. # directory. If chroot_local_user is YES, then this list becomes a list of
  97. # users to NOT chroot().
  98. chroot_local_user=YES
  99. #chroot_list_enable=YES
  100. # (default follows)
  101. #chroot_list_file=/etc/vsftpd/chroot_list
  102. #secure_chroot_dir=/var/run/vsftpd/empty
  103. #
  104. # You may activate the "-R" option to the builtin ls. This is disabled by
  105. # default to avoid remote users being able to cause excessive I/O on large
  106. # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
  107. # the presence of the "-R" option, so there is a strong case for enabling it.
  108. #ls_recurse_enable=YES
  109. #
  110. # When "listen" directive is enabled, vsftpd runs in standalone mode and
  111. # listens on IPv4 sockets. This directive cannot be used in conjunction
  112. # with the listen_ipv6 directive.
  113. listen=YES
  114. #
  115. # This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
  116. # sockets, you must run two copies of vsftpd with two configuration files.
  117. # Make sure, that one of the listen options is commented !!
  118. #listen_ipv6=YES
  119.  
  120. pam_service_name=vsftpd
  121. userlist_enable=YES
  122. tcp_wrappers=YES
  123.  
  124. [Expert@gw-a:0]# ftp 10.15.254.137
  125. Connected to 10.15.254.137 (10.15.254.137).
  126. 220 Welcome to blah FTP service.
  127. Name (10.15.254.137:admin): ftp
  128. 331 Please specify the password.
  129. Password:
  130. 230 Login successful.
  131. Remote system type is UNIX.
  132. Using binary mode to transfer files.
  133. ftp> ls
  134. 227 Entering Passive Mode (10,15,254,137,115,165).
  135. 150 Here comes the directory listing.
  136. 226 Directory send OK.
  137. ftp> get 1.txt
  138. local: 1.txt remote: 1.txt
  139. 227 Entering Passive Mode (10,15,254,137,196,156).
  140. 550 Failed to open file.
  141. ftp> put 1.txt
  142. local: 1.txt remote: 1.txt
  143. 227 Entering Passive Mode (10,15,254,137,43,130).
  144. 553 Could not create file.
  145.  
  146. [root@HOst home]# ls -lh /home
  147. total 12K
  148. dr-xr-xr-x. 3 ftp ftp 4.0K Mar 29 16:56 ftp
  149. drwx------. 2 sk sk 4.0K May 26 2016 sk
  150. drwx------. 2 telnet telnet 4.0K Aug 3 2016 telnet
  151. [root@HOst home]#
  152.  
  153. 500 OOPS: vsftpd: refusing to run with writable anonymous root
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement