#!/bin/bash
#shell脚本自动安装配置vsftpd并创建10个nologin帐户作为ftp测试帐号
#Centos_vsftpd.sh
yum install -y vsftpd
echo "anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
pasv_min_port=65400
pasv_max_port=65410" >/etc/vsftpd/vsftpd.conf
touch /etc/vsftpd/chroot_list
for i in $(seq 10);do useradd test$i -s /sbin/nologin;echo "test$i";echo test$i|passwd test$i --stdin;done
service vsftpd restart
chkconfig vsftpd on
setsebool ftp_home_dir=1
Centos_vsftpd.sh
最新推荐文章于 2023-10-14 16:43:16 发布