您的位置:首页 > 其它

/var/log/secure 日志不记录问题

2012-05-10 23:49 267 查看
直接删除日志文件的时候,对应的服务需要重启。运行命令:service syslog restart ;service sshd restart 后正常。

顺便复习下ssh在syslog中的设置的知识。

1、/etc/ssh/sshd_config 中的设置:(即:SyslogFacility 设为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中的设置:

[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

重新启动sshd和syslog
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息