Redirecting SSH output

Man of Honour
Joined
30 Jun 2005
Posts
9,515
Location
London Town!
I have what I think should be a simple one to solve but I've no idea how. I have a unix box on my desktop for various purposes and one of the things I use it for is to monitor log files in realtime (simply a tail -f). But it has it's own keyboard which is eating my precious desk space, so my question is, can I run a command in an ssh session and pipe it's output to the physical display?

Surely it can't be too hard?

Cheers
 
Not quite sure exactly what you mean.

Just ssh into tthe second box and run the command in a spare terminal window open on your main box. If you need to redirect the X windows then use the -Y argument.

From windows you can ssh using something like putty or securecrt. To redirect X onto windows you need a windows x client like exceed or possible cygwin.
 
Code:
export DISPLAY=:0.0 && xterm -hold -e tail /var/log/messages
 
Sure xterm can't do it though (you could set geometry but its not ideal). If you have gnome-terminal,

Code:
export DISPLAY=:0.0 && gnome-terminal --full-screen -x tail -f /var/log/messages
 
Agree with above export DISPLAY example, but as you are using this as a monitoring tool... how about also running vnc on the server, then exporting the display to that vnc session.

The benefits being...
1) you can view that vnc session using a web browser, on any client machine on the network.
2) This removes any relience of your client machine staying up at all/not rebooting/etc... and the whole setup only relies on the server itself.
3) you can do x-windows stuff in that too.. meaning you wouldn't ever need to install exceed/cygwin/etc.
 
Back
Top Bottom