How to forward dmesg live output through SSH on Linux

1k views Asked by At

On VMWare or on bare metal, Linux display by default live dmesg content directly to stdout.

ifup/ifdown

But when I'm connected through SSH, it doesn't show up even to the command succeeds

How do I forward every dmesg log through SSH ?

dmesg -wH, watch or tail are not what i'm looking for. I don't want to see the whole dmesg, only the live ones and without disrupting my shell.

3

There are 3 answers

0
Cory Salvesen On

You can use dmesg --follow. This is a built-in argument in dmesg.

1
Tangogow On

Thanks @mjf, you were close.

dmesg -W & doesn't seems to be working since -W uppercase doesn't exist, but dmesg -w & with -w lowercase works perfectly.

0
Jarkko Hakala On

To disable messages to console: echo 0 > /proc/sys/kernel/printk. To read messages at a remote machine: ssh yourname@frommachine "cat /dev/kmsg" and to get it into a file at the remote machine while watching: ssh yourname@frommachine "cat /dev/kmsg" | tee frommachinessyslog.log.