ftp服务的配置

来源:互联网 发布:类似啊噜哈的软件 编辑:程序博客网 时间:2024/05/02 02:07
ftp服务的配置
 vsftp服务配置
配置虚拟用户登陆的步骤
1,添加虚拟用户口令文件
vi /etc/vsftpd/vuser.txt
cangls#用户名
123#密码
bols
123
2,生成虚拟用户口令认证文件
db_load -T -t hash -f /etc/vsftpd/vuser.txt  /etc/vsftpd/vuser.db
3,编辑vsftpd的PAM认证文件
vi /etc/pam.d/vsftpd
auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vuser
account required /lib/security/pam_userdb.so db=/etc/vsftpd/vuser
#注掉其它行,加入这两行
4,建立本地映射用户并设置宿主目录权限
useradd -d /home/vsftproot -s /sbin/nologin vuser
chmod 755 /home/vsftproot
5,修改配置文件
vi /etc/vsftpd/vsftpd.conf
guest_enable=YES
guest_username=vuser
pam_service_name=vsftpd
6,重启vsftpd服务,并测试
service vsftpd restart
7,调整虚拟用户权限
vi /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES

单独定义虚拟用户权限
1,修改配置文件
vi /etc/vsftpd/vsftpd.conf
user_config_dir=/etc/vsftpd/vusers_dir
#指定保存虚拟用户配置文件的目录
2,手工建立目录
mkdir /etc/vsftpd/vusers_dir
3,为每个虚拟用户建立配置文件
vi /etc/vsftpd/vusers_dir/cangls
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
#允许此用户上传
local_root=/tmp/vcangls
#给cangls指定独立的上传目录

0 0
原创粉丝点击