最近在Ubuntu 16.04開了VSFTP,但是發現,好像每天都會有發生用戶端無法登入(用的人很少就一、兩位),需要服務重新啟動的問題。想麻煩大家幫忙在下檢查一下。感謝!
查看LOG,只有CONNECT,沒有成功的狀態。
Tue Dec 31 09:05:19 2019 [pid 14171] CONNECT: Client "12X.XX.XX.XX"
Tue Dec 31 09:06:45 2019 [pid 14299] CONNECT: Client "192.168.0.100"
Tue Dec 31 09:05:44 2019 [pid 14272] CONNECT: Client "12X.XX.XX.XX"
Tue Dec 31 09:06:20 2019 [pid 14274] CONNECT: Client "192.168.0.120"
服務重新啟動後就可以了。
Tue Dec 31 09:07:32 2019 [pid 14357] [USER001] OK LOGIN: Client "192.168.0.120"
syslog在重新啟動前的紀錄
Dec 31 09:05:19 SERVER001 vsftpd: pam_ecryptfs: Passphrase file wrapped
Dec 31 09:05:39 SERVER001 systemd[1]: Started Session 59895 of user USER001.
設定檔
anonymous_enable=NO
config file /etc/vsftpd.conf
connect_from_port_20=NO
data_connection_timeout=300
dirmessage_enable=YES
idle_session_timeout=300
listen_ipv6=NO
listen_port=12321
listen=YES
local_enable=YES
pam_service_name=vsftpd
pasv_enable=YES
pasv_max_port=57450
pasv_min_port=57400
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
secure_chroot_dir=/var/run/vsftpd/empty
ssl_enable=NO
use_localtime=YES
write_enable=YES
write_enable=YES
xferlog_enable=YES
pasv_max_port=87450 <-- 是不是數值過大呢
pasv_min_port=87400 <-- 是不是數值過大呢
而且你的設定反正都沒有啟動SSL
你試一下面的設定: (我沒有測試過,所以你要原文備份好)
anonymous_enable=NO
config file /etc/vsftpd.conf
connect_from_port_20=YES
data_connection_timeout=300
dirmessage_enable=YES
idle_session_timeout=300
listen_ipv6=NO
listen_port=12321
listen=NO
local_enable=YES
pam_service_name=vsftpd
pasv_enable=YES
pasv_min_port=55000
pasv_max_port=55500
secure_chroot_dir=/var/run/vsftpd/empty
ssl_enable=NO
use_localtime=YES
write_enable=YES
xferlog_enable=YES
local_umask=022
dirmessage_enable=YES
chroot_local_user=YES