yum install -y db4-utils vsftpd
cat > /etc/vsftpd/user.txt <admin
bestvwin
hadoop
hadoop
EOF
db_load -T -t hash -f /etc/vsftpd/user.txt /etc/vsftpd/vsftpd_login.db
chmod 600 /etc/vsftpd/vsftpd_login.db
cat > /etc/pam.d/vvsftpd << EOF
#%PAM-1.0
auth required /lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login
account required /lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login
EOF
useradd -s /sbin/nologin vftpuser
chown -R vftpuser. /var/ftp/pub/
cat > /etc/vsftpd/vsftpd.conf <anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=NO
anon_mkdir_write_enable=NO
local_root=/var/ftp/pub
virtual_use_local_privs=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
log_ftp_protocol=YES
xferlog_std_format=NO
vsftpd_log_file=/var/log/vsftpd.log
ftpd_banner=Welcome to Hadoop FTP Service.
listen=YES
pasv_enable=YES
pasv_min_port=10000
pasv_max_port=20000
guest_enable=YES
guest_username=vftpuser
pam_service_name=vvsftpd
userlist_enable=YES
tcp_wrappers=YES
EOF
阅读(1655) | 评论(0) | 转发(0) |