Friday, January 25, 2008

Tail remote logs


In this post, I mentioned that I was looking for a way to tail log files on a remote computer. Stig commented with a suggestion.  You can specify the sudo and tail command to ssh




ssh user@hostname 'sudo tail -f /var/log/messages'



I am using this solution, but there are two problems:



  1. Your password will appear in the clear in the terminal window when entering it for the sudo command

  2. sudo has to be configured to work on a non-tty terminal, which could be a security hole.