上天查看了服務(wù)器安全日志,防火墻屏蔽了處理了一些暴力破解ssh密碼的ip(其中一個ip地址為北京一家有名的CDN服務(wù)提供商),然后刪除了所有的/var/log/secure* 日志文件。
今天再來查看日志的時候,發(fā)現(xiàn)/var/log/secure竟然沒有記錄,才想到直接刪除日志文件的時候,對應(yīng)的服務(wù)需要重啟。運(yùn)行命令:service syslog restart ;service sshd restart 后正常。
順便復(fù)習(xí)下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級別。
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.
# Don't 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
重新啟動sshd和syslog
億恩科技地址(ADD):鄭州市黃河路129號天一大廈608室 郵編(ZIP):450008 傳真(FAX):0371-60123888
聯(lián)系:億恩小凡
QQ:89317007
電話:0371-63322206 本文出自:億恩科技【www.riomediacenter.com】
服務(wù)器租用/服務(wù)器托管中國五強(qiáng)!虛擬主機(jī)域名注冊頂級提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|