配置文件位置:
/etc/vsftpd.conf
配置内容如下:
listen=YES
listen_ipv6=NO
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=NO
chroot_list_file=/etc/vsftpd.chroot_list
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
allow_writeable_chroot=YES
pasv_enable=Yes
pasv_min_port=40000
pasv_max_port=40100
与自带的example的文件相比,具体改动了以下几项:
listen=YES
listen_ipv6=NO
#是否把ftpuser固定在自身的家目录,推荐是yes
chroot_local_user=NO
#允许登陆ftp的用户
chroot_list_file=/etc/vsftpd.chroot_list
添加ftp用户,设置账号密码家目录:
useradd -d /bcc/levelData -g ftp -p ftp_mima ftp_bcc
然后就可以在别的地方登陆ftp了,这里以windows里面的cmd为例:
2、后来主动被动:2018-06-19
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_file=/var/log/vsftpd.log
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=ftp
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
utf8_filesystem=YES
use_localtime=YES
connect_timeout=60
accept_timeout=60
max_clients=8
max_per_ip=8
#主动模式
port_enable=YES
connect_from_port_20=NO
ftp_data_port=21
pasv_promiscuous=YES
#被动模式
#pasv_enable=YES
#pasv_min_port=30000
#pasv_max_port=30001