Chinaunix首页 | 论坛 | 博客
  • 博客访问: 306902
  • 博文数量: 34
  • 博客积分: 1944
  • 博客等级: 上尉
  • 技术积分: 400
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-01 23:22
文章分类

全部博文(34)

文章存档

2010年(2)

2009年(4)

2008年(28)

分类: LINUX

2008-04-11 19:15:20

vsftpd 基本配置实践 匿名anonymous用户上传文件 和 root 登陆
可可火山 20080411


以下为在CentOS中测试,让匿名anonymous用户上传文件,一切配置文件从初时状态开始:
1.file:/etc/vsftpd/vsftpd.conf
#
# 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
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
anon_mkdir_write_enable=YES
2.anonymous登陆后发现还是不能upload,报权限错误,不管在/目录还是/pub.检查/pub权限发现权限很低.
[root@CentOS5 pub]# ls -ld /var/ftp/pub/
drwxr-xr-x 3 root root 4096 Mar 17 00:07 /var/ftp/pub/
这个时候需要建个目录来让用户上传.
[root@CentOS5 pub]# mkdir /var/ftp/incomming
[root@CentOS5 pub]# chmod a+w /var/ftp/incomming
3.重新匿名用户登陆,在/incomming内上传文件和建目录OK.


以下为在CentOS中测试,让root通过ftp登陆,一切配置文件从初时状态开始:
1.删除/etc/vsftpd/user_list中的root一行.
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
这样用root登陆,不会直接deny,但输入正确密码还是不能登陆.查看/etc/log/secure就可以发现pam阻止了root的登陆.
2.找到/etc/pam.d/vsftpd发现pam会检查/etc/vsftpd/ftpusers配置文件.
打开/etc/vsftpd/ftpusers的第一行说明了这个配置文件的作用
# Users that are not allowed to login via ftp
删除root一行重启vsftpd后root就可以登陆了.

后话:1.ftp属于明文传输,有安全隐患.更不用说拿root直接登陆ftp.
     2.推荐使用ssh,即可以跑命令也可以传文件.
阅读(4032) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~