更新時(shí)間:2022-02-09 09:56:32 來源:動(dòng)力節(jié)點(diǎn) 瀏覽2875次
ssh在syslog中如何設(shè)置?
1./etc/ssh/sshd_config 中的設(shè)置:(即:SyslogFacility 設(shè)為AUTHPRIV)
[root@mail ~]# more /etc/ssh/sshd_config
#Port 22
# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
<strong>SyslogFacility AUTHPRIV</strong>
#LogLevel INFO
#就是把sshd的日志定義在authriv.info級(jí)別。
2.配合/etc/syslog.conf中的設(shè)置:
[root@mail ~]# more /etc/syslog.conf
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.* /dev/console
# Log anything (except mail) of level info or higher.
# Dont log private authentication messages!
*.info;mail.none;authpriv.none;cron.none /var/log/messages
# The authpriv file has restricted access.
<strong>authpriv.* /var/log/secur</strong>e
重新啟動(dòng)sshd和syslog
初級(jí) 202925
初級(jí) 203221
初級(jí) 202629
初級(jí) 203743