SUDO Output

 
SOLVED
Go to solution
wayne_104
Regular Advisor

SUDO Output

how do i stop the sudo output going to the console?

Cannot see it defined in sudoers file.
4 REPLIES 4
Kenan Erdey
Honored Contributor
Solution

Re: SUDO Output

Hi,

add this line, as default bad logins uses alert and it sends to console.

Defaults syslog_badpri=info
Computers have lots of memory but no imagination
wayne_104
Regular Advisor

Re: SUDO Output

hi please tell me what that will do?

will it still log to the log file as below

Defaults log_output
Defaults!/usr/bin/sudoreplay !log_output
Defaults!/usr/local/bin/sudoreplay !log_output
Defaults!/sbin/reboot !log_output
Matti_Kurkela
Honored Contributor

Re: SUDO Output

The message is not output to the console by sudo itself, but by the syslog daemon.

Kenan's suggestion is related to syslog message priority levels used by sudo, and what syslog is configured to do with them.

By default, sudo sends messages of failed attempts to use sudo to syslog using priority class "alert".

The HP-UX syslog daemon is typically configured to output serious error messages (including messages of priority class "alert") to the console in addition to writing them to the syslog file. Another typical configuration is that the messages of the highest priority class ("emerg") are sent out to every running session, somewhat like what the "wall" command does.

Kenan's suggestion is to reduce the syslog priority of the messages sent by sudo to "info". That is a very low priority level: it is only written to the syslog file by default, not output to the console.

Syslog also classifies messages by "facility" categories: you should read the /etc/syslog.conf file to see what syslog is configured to do with each facility/priority combination.

An alternative way to solve this problem would be to configure the syslog daemon to not output messages of the authentication facility to the console. But Kenan's solution affects only sudo, so it has less side effects.

MK
MK
wayne_104
Regular Advisor

Re: SUDO Output

You guys are both stars thank you so very much.