分类:
2008-06-21 01:03:28
在Linux平台下:
虚拟用户的vsftp服务:
所有文件位于/etc/vsftpd目录下:
1.
shell> vim login.txt
vim > a #---用户名---
vim > a #---密码 ----
vim > wq
注意用户名和密码的书写格式,换行
2.
shell> db_load -T -t hash -f login.txt vsftpd_login.db
加密用户密码
3.
shell> useradd -d /tmp/ftp/ virtualuser
4.
shell> vim vsftpd.conf
vim > local_enable=YES
VIM > write_enable=YES
WIM > local_umask=022
vim > xferlog_enable=YES
vim > connect_from_port_20=YES
vim > nopriv_user=tluser
VIM > xferlog_file=/var/log/vsftpd.log
vim > xferlog_std_format=YES
VIM > chroot_local_user=YES
VIM > listen=YES
VIM > pam_service_name=vsftpd.vu #使用的验证模块
vim > guest_enable=yes #启用虚拟用户
vim > geust_username=virtualuser #映射为本地用户
vim > virtual_use_local_privs=YES #虚拟用户与本地用户权限映射
vim > userlist_enable=YES #
VIM > userlist_deny=NO #在user_list文件中列出的用户才能使用ftp
vim > userlist_file=/etc/vsftpd/user_list #
vim > tcp_wrappers=YES
vim > wq
5.
建立/etc/pam.d/vsftpd.vu文件
shell> vsftpd.vu
vim > auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login
account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login
这个服务开21端口,由系统启动或/etc/init.d/vsftpd restart | start ;
本地用户使用的ftp服务
shell> vim /etc/vsftpd/vsftpdlocal.conf
vim > listen_port=2121 #使用2121端口
local_enable=YES
write_enable=YES
local_umask=022
xferlog_enable=YES
xferlog_std_format=YES
xferlog_file=/var/log/vsftpd.log
chroot_local_user=YES
userlist_enable=YES
userlist_deny=NO
userlist_file=/etc/vsftpd/user_list
listen=YES
pam_service_name=vsftpd #这个验证模块在/etc/pam.d/下有
connect_from_port_20=YES
tcp_wrappers=YES
启动: /usr/sbin/vsftpd /etc/vsftpd/vsftpdlocal.conf
或建一个shell脚本:
Shell> vim vsftpdlocal.sh
vim > #!/bin/bash
/usr/sbin/vsftpd /etc/vsftpd/vsftpdlocal.conf
其它说明同上.