[H-GEN] VNC for console apps??
Russell Stuart
russell at stuart.wattle.id.au
Fri May 16 04:17:16 EDT 2003
[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]
On Fri, 2003-05-16 at 16:12, ben.carlyle at invensys.com wrote:
> from http://packages.debian.org/unstable/admin/ttysnoop.html:
> "TTYSnoop allows you to snoop on login tty's through another tty-device or
> pseudo-tty. The snoop-tty becomes a 'clone' of the original tty,
> redirecting both input and output from/to it.".
>
> ie, it works on a login tty like vnc does for a gui just as the author
> requested. You can both view and type into the terminal when you run
> ttysnoop after sshing into the appropriate machine.
I did stumble over ttysnoop when I went looking for a solution. Looking
at the code, it just creates a PTY and runs the command (login, getty or
whatever) in that, pumping data between the PTY and the real underlying
TTY. In that way its not too different from "telnet 127.0.0.1". It
also binds and listens to a socket. Should someone open that socket it
duplicates all data arriving on the real TTY to the socket, rather like
the tee program. Any data sent down the socket is written to the TTY,
as if the user had typed it.
All well and good. I imagine it works very well for spying on someone
doing system admin stuff in a shell. But there is no state stored. So
it is not possible to connect to the ttysnoop'ed port and see what they
are seeing. You only get to see what comes down the TTY after you have
connected. That makes it useless for displaying the dialogue box or
kernel message that is currently on the screen now, for instance.
That is alright. /dev/vcs solves that problem nicely. But
disappointingly, they don't solve the "how to inject characters into the
tty buffer" problem either.
Well, I will have to look in the kernel. (Looking ...). Ah yes, there
it is, in tty_ioctl.c. The TTY ioctl TIOCSTI puts one character into
the tty receive buffer. So there you go. A text VNC is possible,
almost easy. It is hard to believe someone has not written it already.
--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'. See http://www.humbug.org.au/
More information about the General
mailing list