SFTP服务器记录文件配置

版权声明:博客地址:https://blog.csdn.net/weixin_41028208,未经博主允许不得转载。QQ:335848046。微博:小黑_songrn。 https://blog.csdn.net/weixin_41028208/article/details/82821691

通过SFTP上传、删除文件,怎样记录日志呢,可以如此如此:
1.修改SSH配置:

vim /etc/ssh/sshd_config
# 修改
Subsystem       sftp    /usr/lib64/ssh/sftp-server -l INFO -f AUTH
  1. 修改syslog
vim /etc/syslog.conf
# 增加一行
auth,authpriv.*                                         /var/log/sftp.log
  1. 重启后查看/var/log/sftp.log
/etc/init.d/syslog restart
/etc/init.d/sshd restart
cat /var/log/sftp.log

猜你喜欢

转载自blog.csdn.net/weixin_41028208/article/details/82821691