specimen

25 Jan, 2008

Tail remote logs

Posted by pwestbro 21:51 | Permalink Permalink | Comments Comments (1) | Trackback Trackbacks (0) | Computer

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.

Technorati tags: , , ,

Comments

How about using SSH to set up a tunnel between 2 random ports, and then run local and remote instances of 'nc' to pipe the file through the tunnel? That way, you could de-couple the ssh from the cat, and not have the same kind of issues? I can dig up an example if you'd like, but there are some good nc examples on the man page...

Posted by slacy 26 Jan 2008, 09:03
Add comment
Add comment