vsftpd能匿名登陆,但不能本地用户登陆??

发布于 2022-07-18 11:27:26 字数 48 浏览 7 评论 8

这两种用户能同时登陆FTP吗??
我想让FTP匿名登陆只能下载,本地用户登陆能够上传

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

铁憨憨 2022-07-25 01:55:53

顶起来~~

鹤仙姿 2022-07-25 01:45:44

原帖由 flashhand 于 2006-7-11 17:53 发表
楼上兄弟,你这vsftp配的,如果不加chroot_local_user=YES,相当于把整个机子给人家ftp了

chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list

??
这样不一样吗?反正匿名的时候能把用户ftp限制在家目录的

森罗 2022-07-25 01:43:13

楼上兄弟,你这vsftp配的,如果不加chroot_local_user=YES,相当于把整个机子给人家ftp了

关于从前 2022-07-25 01:20:38

原帖由 marsaber 于 2006-7-10 16:26 发表
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsf ...

这是我的/etc/vsftpd.conf

  1. # Example config file /etc/vsftpd.conf
  2. #
  3. # The default compiled in settings are fairly paranoid. This sample file
  4. # loosens things up a bit, to make the ftp daemon more usable.
  5. # Please see vsftpd.conf.5 for all compiled in defaults.
  6. #
  7. # READ THIS: This example file is NOT an exhaustive list of vsftpd options.
  8. # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
  9. # capabilities.
  10. #
  11. # Allow anonymous FTP? (Beware - allowed by default if you comment this out).
  12. anonymous_enable=YES
  13. #
  14. # Uncomment this to allow local users to log in.
  15. local_enable=YES
  16. #local_root=/var/ftp/upload
  17. #
  18. # Uncomment this to enable any form of FTP write command.
  19. write_enable=YES
  20. #
  21. # Default umask for local users is 077. You may wish to change this to 022,
  22. # if your users expect that (022 is used by most other ftpd's)
  23. local_umask=022
  24. #
  25. # Uncomment this to allow the anonymous FTP user to upload files. This only
  26. # has an effect if the above global write enable is activated. Also, you will
  27. # obviously need to create a directory writable by the FTP user.
  28. anon_upload_enable=NO
  29. #
  30. # Uncomment this if you want the anonymous FTP user to be able to create
  31. # new directories.
  32. anon_mkdir_write_enable=NO
  33. #
  34. # Activate directory messages - messages given to remote users when they
  35. # go into a certain directory.
  36. dirmessage_enable=YES
  37. #
  38. # Activate logging of uploads/downloads.
  39. xferlog_enable=YES
  40. #
  41. # Make sure PORT transfer connections originate from port 20 (ftp-data).
  42. connect_from_port_20=YES
  43. #
  44. # If you want, you can arrange for uploaded anonymous files to be owned by
  45. # a different user. Note! Using "root" for uploaded files is not
  46. # recommended!
  47. #chown_uploads=YES
  48. #chown_username=whoever
  49. #
  50. # You may override where the log file goes if you like. The default is shown
  51. # below.
  52. xferlog_file=/var/log/vsftpd.log
  53. #
  54. # If you want, you can have your log file in standard ftpd xferlog format
  55. #xferlog_std_format=YES
  56. #
  57. # You may change the default value for timing out an idle session.
  58. idle_session_timeout=600
  59. #
  60. # You may change the default value for timing out a data connection.
  61. #data_connection_timeout=120
  62. #
  63. # It is recommended that you define on your system a unique user which the
  64. # ftp server can use as a totally isolated and unprivileged user.
  65. #nopriv_user=ftpsecure
  66. #
  67. # Enable this and the server will recognise asynchronous ABOR requests. Not
  68. # recommended for security (the code is non-trivial). Not enabling it,
  69. # however, may confuse older FTP clients.
  70. #async_abor_enable=YES
  71. #
  72. # By default the server will pretend to allow ASCII mode but in fact ignore
  73. # the request. Turn on the below options to have the server actually do ASCII
  74. # mangling on files when in ASCII mode.
  75. # Beware that turning on ascii_download_enable enables malicious remote parties
  76. # to consume your I/O resources, by issuing the command "SIZE /big/file" in
  77. # ASCII mode.
  78. # These ASCII options are split into upload and download because you may wish
  79. # to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
  80. # without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
  81. # on the client anyway..
  82. #ascii_upload_enable=YES
  83. #ascii_download_enable=YES
  84. #
  85. # You may fully customise the login banner string:
  86. ftpd_banner=Welcome to LB's FTP service.
  87. #
  88. # You may specify a file of disallowed anonymous e-mail addresses. Apparently
  89. # useful for combatting certain DoS attacks.
  90. #deny_email_enable=YES
  91. # (default follows)
  92. #banned_email_file=/etc/vsftpd.banned_emails
  93. #
  94. # You may specify an explicit list of local users to chroot() to their home
  95. # directory. If chroot_local_user is YES, then this list becomes a list of
  96. # users to NOT chroot().
  97. chroot_list_enable=YES
  98. # (default follows)
  99. chroot_list_file=/etc/vsftpd.chroot_list
  100. #
  101. # You may activate the "-R" option to the builtin ls. This is disabled by
  102. # default to avoid remote users being able to cause excessive I/O on large
  103. # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
  104. # the presence of the "-R" option, so there is a strong case for enabling it.
  105. #ls_recurse_enable=YES
  106. listen=YES
  107. listen_port=21
  108. anon_root=/var/ftp/download
  109. ###转码相关
  110. charset_filter_enable=YES
  111. charset_client=GBK
  112. charset_server=UTF-8

复制代码

/etc/vsftpd.chroot_list中的内容为:
cat /etc/vsftpd.chroot_list
ftp
upload

ftp是默认的匿名登陆用户,我新建了upload,并设置了密码,uploade的家目录是/var/ftp/upload
现在匿名能登陆,并且只能下载,满足了我的要求
可是upload还是不能登陆(当然密码是100%正确的):
尝试 127.0.0.1:21
已连接到 127.0.0.1:21
220 Welcome to LB's FTP service.
USER upload

331 Please specify the password.
PASS xxxx
530 Login incorrect.
正在断开与站点 127.0.0.1 的连接

时光沙漏 2022-07-25 00:30:09

不好意思,复制上去,忘改了,

梓梦 2022-07-24 22:07:03

原帖由 世界因我而精彩 于 2006-7-10 16:25 发表
当然可以了,

anonymous_enable=NO
local_enable=YES        
write_enable=YES

你还anonymous_enable=NO呢!
人家允许匿名用户下载啊!

╰沐子 2022-07-22 15:13:52

# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES      #YES的话就是允许匿名用户登陆.
#
# Uncomment this to allow local users to log in.
#local_enable=YES               #YES的话就是允许本地用户登陆.
#
# Uncomment this to enable any form of FTP write command.
#write_enable=YES              #YES的话就是允许写入.
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#local_umask=022               #默认的UMASK码,建议不做修改.
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES  #YES的话就是允许匿名用户上传文件.
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES   #YES的话就是允许匿名用户创建目录
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format
#xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES

chroot_local_user=YES  #在最后面添加该段代码的意思就是限制本地用户登陆后在只能在自家home目录内活动.

旧人 2022-07-22 13:29:48

当然可以了,

anonymous_enable=NO
local_enable=YES        
write_enable=YES

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文