I have created the file /var/log/vsftpd.log with touch command, reboot my router and ssh login it, strange enough, the file /var/log/vsftpd.log gone,disapeared!
I guess that openwrt remove vsftpd.log automatically,same thing happens when to make configuration for samba,you have to edite in the template---/etc/samba/smb.conf.template,if not, the edited lines in smb.conf lost after rebooting.
Where should i edite a template for vsftpd ?
I can't check log at all.
I haven't checked all your log related options (do it on your own with the referenced manpage). Just start with the three log options I've provided in my first post and restart the vsftpd service afterwards.
Delete all my setting and copy your setting,restart vsftpd.
Three issues remain:
1.can't login with nobody
2.no log record when to login with ftpadmin
3.the /var/log/vsftpd.log automatically deleted after rebooting my router.
I have set ddns and port forwarding on my router ,anyone is willing to help me ,please send email to elearn2014@gmail.com, i email you the password ,you can remotely login my router,and check what happened.
logread | grep ssh
Sat Jun 12 07:34:21 2021 auth.info sshd[2055]: Server listening on :: port 22.
Sat Jun 12 07:34:21 2021 auth.info sshd[2055]: Server listening on 0.0.0.0 port 22.
Sat Jun 12 07:37:33 2021 auth.err sshd[3887]: error: kex_exchange_identification: Connection closed by remote host
Sat Jun 12 07:38:10 2021 auth.info sshd[3888]: Accepted password for ftpadmin from 192.168.2.144 port 33466 ssh2
Sat Jun 12 07:38:27 2021 auth.info sshd[3892]: Accepted password for root from 192.168.2.144 port 33468 ssh2
Sat Jun 12 07:41:56 2021 auth.err sshd[4090]: error: kex_exchange_identification: Connection closed by remote host
Why can't write the log records into /var/log/vsftpd.log?
sftp is a file transfer program, similar to ftp(1), which performs all operations over an encrypted ssh(1) transport. It use ftp over ssh,i have create user--ftpadmin for my vsftp.
Sat Jun 12 07:38:10 2021 auth.info sshd[3888]: Accepted password for ftpadmin from 192.168.2.144 port 33466 ssh2
SSHD log the info when ftpadmin try to login ,it is also a log record for vsftpd.
How can i set vsftpd log directly and successfully then?
No, they're both protocols, but there are applications using the same name as the protocol.
you probably can't, because you're talking to the FTP server via SSH.
Unless you'd like to have all ssh logging to the vsftp log.
or look into the syslog-ng package, or some other logging tool.
I don't think it's the real issue, i think it's the fact the actual logon gets written to the system log by ssh, but that's to be expected, since the traffic is coming in through there.