1.修改ssh的配置文件(#开头代表root用户权限),找到Subsystem sftp /usr/libexec/openssh/sftp-server ,添加 -l INFO -f AUTH 选项
# vim /etc/ssh/sshd_config
Subsystem sftp /usr/libexec/openssh/sftp-server -l INFO -f AUTH
2.修改rsyslog的配置,添加配置项 auth,authpriv.* /var/log/sftp.log
# vim /etc/rsyslog.conf
auth,authpriv.* /var/log/sftp.log
3.重启ssh、rsyslog服务
# systemctl restart sshd.service # systemctl restart rsyslog.service
4.观察效果
关于rsyslog解释关注下面链接
https://blog.csdn.net/paopaohll/article/details/84388313