1.修改ssh的配置文件(#開頭表明root用戶權限),找到Subsystem sftp /usr/libexec/openssh/sftp-server ,添加 -l INFO -f AUTH 選項vim
# vim /etc/ssh/sshd_config
Subsystem sftp /usr/libexec/openssh/sftp-server -l INFO -f AUTHbash
2.修改rsyslog的配置,添加配置項 auth,authpriv.* /var/log/sftp.logssh
# vim /etc/rsyslog.conf
auth,authpriv.* /var/log/sftp.logide
3.重啓ssh、rsyslog服務spa
# systemctl restart sshd.service # systemctl restart rsyslog.service
4.觀察效果.net
關於rsyslog解釋關注下面連接rest
https://blog.csdn.net/paopaohll/article/details/84388313server