How do I stop my Linode from printing low level messages?
When I log into my SSH session, lines like the following keep scrolling and I am unable to see what I type in.
DROP: IN= OUT=eth0 SRC=xxx.xxx.xxx.xxx DST=xxx.xxx.xxx.xxx LEN=76 TOS=0x00 PREC=0x
DROP: IN= OUT=eth0 SRC=xxx.xxx.xxx.xxx DST=xxx.xxx.xxx.xxx LEN=76 TOS=0x00 PREC=0x00
DROP: IN= OUT=eth0 SRC=xxx.xxx.xxx.xxx DST=xxx.xxx.xxx.xxx LEN=76 TOS=0x00 PREC=0x
DROP: IN= OUT=eth0 SRC=xxx.xxx.xxx.xxx DST=xxx.xxx.xxx.xxx LEN=76 TOS=0x00 PREC=0x00
DROP: IN= OUT=eth0 SRC=xxx.xxx.xxx.xxx DST=xxx.xxx.xxx.xxx LEN=76 TOS=0x00 PREC=0x
DROP: IN= OUT=eth0 SRC=xxx.xxx.xxx.xxx DST=xxx.xxx.xxx.xxx LEN=76 TOS=0x00 PREC=0x00
DROP: IN= OUT=eth0 SRC=xxx.xxx.xxx.xxx DST=xxx.xxx.xxx.xxx LEN=76 TOS=0x00 PREC=0x
DROP: IN= OUT=eth0 SRC=xxx.xxx.xxx.xxx DST=xxx.xxx.xxx.xxx LEN=76 TOS=0x00 PREC=0x00
DROP: IN= OUT=eth0 SRC=xxx.xxx.xxx.xxx DST=xxx.xxx.xxx.xxx LEN=76 TOS=0x00 PREC=0x
How can I stop this?
2 Replies
Hey there! It looks like your firewall is printing every time it drops a connection. I believe what you will need to do is edit your /etc/sysctl.conf file to not show low-level messages in the console. You will want to look for a line like the following:
# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3
If you copy and paste sudo nano /etc/sysctl.conf
into your SSH session then press the enter button, you should be taken to a session to edit the file.
From there, you can uncomment that kernel.printk line. From there you can press CTRL+X
to save the file and follow the prompts to save it.
I hope this was helpful! Please let us know here if this works or if you continue to run into issues.
It is also worth mentioning that this may be part of your iptables rule set. You can see an example of some what a logging rule in an iptables rule set looks like, here:
It is the lines that are sent to LOG
that are relevant. In that example, if any packet reaches that point in the rule set, and that rule is used, it is logged at a log level of 7.
Another way to view this information would be to run the following command and find a LOG
entry.
$ sudo iptables -vL
There is an example of this output in the same guide, a little further up.
Notes on these log level and printk numbers
@scrane's example works by only printing higher priority logs (lower printk values) to the console. It will not log events with a log level that is higher than 3. It will also set a log level to a default of 4 in no level is provided, which is higher than 3 so it is not printed to the console.
StackExchange answer on the meaning of the values for kernel.printk
.