yum install -y vsftpd chkconfig vsftpd on vi /etc/vsftpd/vftpuser.txt #vpnuser #vpnpwd rpm -qa|grep db4-utils db_load -T -t hash -f /etc/vsftpd/vftpuser.txt /etc/vsftpd/vftpuser.db vi /etc/pam.d/vsftpd #auth required /lib64/security/pam_userdb.so db=/etc/vsftpd/vftpuser #account required /lib64/security/pam_userdb.so db=/etc/vsftpd/vftpuser useradd -d /home/vftpsite -s /sbin/nologin vftpuser chmod 700 /home/vftpsite vi /etc/vsftpd/vsftpd.conf ############ listen=YES listen_port=12580 connect_from_port_20=YES ftp_data_port=20 pasv_enable=YES pasv_min_port=30000 pasv_max_port=30999 tcp_wrappers=YES local_enable=YES chroot_local_user=yes anonymous_enable=NO guest_enable=YES guest_username=vftpuser user_config_dir=/etc/vsftpd/vsftpd_user_conf pam_service_name=/etc/pam.d/vsftpd ftpd_banner=Welcome to Rekoo FTP server dirmessage_enable=YES xferlog_enable=YES xferlog_file=/var/log/vsftpd.log xferlog_std_format=YES idle_session_timeout=600 check_shell=NO ###### end ####### mkdir -p /etc/vsftpd/vsftpd_user_conf cd /etc/vsftpd/vsftpd_user_conf vim skyland_ftp #### 注意:此文件名与/etc/vsftpd/vftpuser.txt 中的vpnuser需一致 ################# local_root=/home/ftpdir virtual_use_local_privs=NO write_enable=YES anon_world_readable_only=NO anon_upload_enable=YES anon_other_write_enable=YES anon_mkdir_write_enable=YES anon_umask=0022 chmod_enable=YES file_open_mode=0775 ########end############# chown vftpuser.vftpuser /home/ftpdir###授权ftp目录 /etc/init.d/vsftpd restart ## 注意检查pam_userdb.so 的全路径 修改/etc/pam.d/vsftpd 中,跟全路径一致 #find / -name "pam_userdb.so" #vim /etc/pam.d/vsftpd #service vsftpd restart
时间: 2024-10-25 17:36:20