|
新建了 一个 用户guest 用来映射到虚拟用户, 家目录为/home/guest ,该用户可以正常登录桌面。未启用虚拟用户功能时也可以登录ftp
vsftp.conf:
write_enable=YES
guest_enable=yes
local_enable=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
anonymous_enable=YES
anon_world_readable_only=YES
syslog_enable=YES
log_ftp_protocol=YES
vsftpd_log_file=/var/log/vsftpd.log
connect_from_port_20=YES
pam_service_name=vsftpd
listen=YES
ssl_enable=NO
/etc/pam.d/vsftpd:
# Uncomment this to achieve what used to be ftpd -A.
# auth required pam_listfile.so item=user sense=allow file=/etc/ftpchroot onerr=fail
auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
# Uncomment the following line for anonymous ftp.
auth sufficient pam_ftp.so
auth required pam_shells.so
auth include common-auth
account include common-account
password include common-password
session required pam_loginuid.so
session include common-session
auth required /lib/security/pam_userdb.so db=/etc/vsftpd_login
account required /lib/security/pam_userdb.so db=/etc/vsftpd_login
虚拟用户名,密码为:ftpguest,ftpguest
登录失败 ,vsftpd日志:
Feb 15 14:17:30 linux-server vsftpd: Thu Feb 15 14:17:30 2007 [pid 6859] CONNECT: Client "127.0.0.1"
Feb 15 14:17:30 linux-server vsftpd: Thu Feb 15 14:17:30 2007 [pid 6859] FTP response: Client "127.0.0.1", "220 "Welcome to Redsonic-Linux FTP service.""
Feb 15 14:17:34 linux-server vsftpd: Thu Feb 15 14:17:34 2007 [pid 6859] FTP command: Client "127.0.0.1", "USER ftpguest"
Feb 15 14:17:34 linux-server vsftpd: Thu Feb 15 14:17:34 2007 [pid 6859] [ftpguest] FTP response: Client "127.0.0.1", "331 Please specify the password."
Feb 15 14:17:37 linux-server vsftpd: Thu Feb 15 14:17:37 2007 [pid 6859] [ftpguest] FTP command: Client "127.0.0.1", " ASS <password>"
Feb 15 14:17:37 linux-server vsftpd: pam_userdb(vsftpd:auth): user 'ftpguest' granted access
Feb 15 14:17:37 linux-server vsftpd: Thu Feb 15 14:17:37 2007 [pid 6858] [ftpguest] FAIL LOGIN: Client "127.0.0.1"
Feb 15 14:17:38 linux-server vsftpd: Thu Feb 15 14:17:38 2007 [pid 6859] [ftpguest] FTP response: Client "127.0.0.1", "530 Login incorrect."
日志中的 user 'ftpguest' granted access 说明用户已被接受,但下面的却fail login 。可以确定用户身份验证已通过,因为我尝试过错误密码,日志里的服务端里会直接记录该密码错误。 另外我使用的是suse10.2 之前在fc6下配置vsftp虚拟用户没有什么问题。 |
|