In Linux, before a window manager is running, if I hit the Windows key from a console (or alt+F12), I can see kernel messages. I would like to disable the kernel messages from displaying at all since sensitive information could be displayed even before a user is authenticated on the system.

Where do I make this change, /etc/inittab, or some other file?

I did a grep for 12 in /etc and see /etc/rc.conf (I'm on gentoo) and the number of ttys allocated is 12. I am changing this to the number I actually have assigned gettys which is 6, hoping that will disable the kernel output since there should not be anything on that tty. It is interesting though why the kernel output is just on tty12 and not 7 - 12.

  • Rename the title to a round sentence. Since you have more than 300 rep, also you have a reopen vote about your own questions. – peterh - Reinstate Monica Oct 14 '17 at 12:09

That is a kernel command line option, set at boot. It's usually part of grub's configuration (in /etc/default/grub). Look for this line:


After editing, you'll need to run update-grub with root privileges. Make sure your /boot partition is mounted before the update, if it's a separate partition.

| improve this answer | |
  • Ah, so, since it's part of the kernel, then if I build my own kernel, I can simply disable it there too, right? – Walter Oct 15 '17 at 10:43
  • Actually, not sure how I missed this earlier when grepping, but /etc/syslog-ng/syslog-ng.conf has the configuration to log to tty12 by default. I will update that, but in addition, I should ensure that tty12 isn't configured to display anything. – Walter Oct 15 '17 at 11:06

Actually, the problem was syslog, I merely commented / removed these lines:

sed -i "s/^log { source(src); destination(console_all); };/#log { source(src); destination(console_all); };/" /etc/syslog-ng/syslog-ng.conf

sed -i "s/^destination console_all/#destination console_all/" /etc/syslog-ng/syslog-ng.conf

The first one is required, the second one was just to cleanup and ensure I'm not using it anywhere else.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.