pencat

从明天起,关心粮食和蔬菜。我有一所房子,面朝大海,春暖花开

« 远程打印流程SSO方案 »

ubuntu 7.10 vsftp的虚拟用户设置

第一步: 配置PAM
[root@www linux]# vi /etc/pam.d/vsftpd

#%PAM-1.0
session optional pam_keyinit.so force revoke
auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_users
account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_users
#auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed
#auth required pam_shells.so
#auth include system-auth
#account include system-auth
#session include system-auth
#session required pam_loginuid.so

 

第二步: 建立vsftp的本地帐户

[root@www linux]# adduser -d /home/ftp/ pencat

 

第三步: 配置vsftp

[root@www linux]# vim /etc/vsftpd.conf

local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
chroot_local_user=YES
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
user_sub_token=$USER
local_root=/home/ftp/$USER
guest_enable=YES
guest_username=pencat
anon_umask=0022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
anonymous_enable=NO

 

第四步: 建立虚拟用户

[root@www linux]# vim /etc/vsftpd/vsftpd_users.txt

username
password
pencat
password for pencat

[root@www linux]# db3_load -T -t hash -f /etc/vsftpd/vsftpd_users.txt /etc/vsftpd/vsftpd_users.db

[root@www linux]# chmod 600 /etc/vsftpd/vsftpd_users.db /etc/vsftpd/vsftpd_users.txt

这里需要注意ubuntu 7.10下需要用db3_load, 否则验证是会失败的.

 

第五步: 建立虚拟用户的目录,以及设置权限

[root@www linux]# mkdir -p /home/ftp/username

[root@www linux]# mkdir -p /home/ftp/pencat

[root@www linux]# chwon -R pencat.pencat /home/ftp


第六步: 完成并测试

[root@www linux]# tail -f /var/log/auth.log

Mar 2 15:14:51 www vsftpd: pam_userdb(vsftpd:auth): user 'pencat' granted access

 

[EOF]

  • 相关文章:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

最新评论及回复

最近发表

Powered By Z-Blog 1.8 Devo Build 80201

Copyright © 1998-2007 bigcomic.com All rights reserved.