Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.unix.internals Subject: Re: Watch, Spy, whatever you wanna call it Message-ID: <12699:Sep2103:13:0290@kramden.acf.nyu.edu> Date: 21 Sep 90 03:13:02 GMT References: <29835@netnews.upenn.edu> Distribution: usa Organization: IR Lines: 31 In article <29835@netnews.upenn.edu> kehoe@scotty.dccs.upenn.edu (Brendan Kehoe) writes: > Well, anyway, what's the deal? Has one ever been written for under Unix? (With > the plethora of hackers [old definition, not vernacular] that have and are in > the Unix world today, I'd be really surprised if it hadn't.) It's pretty easy to do with my pty program. (What isn't? :-) ) A user runs his session through the following script, sessplex, rather than the usual sess: #!/bin/sh ( umask 077; touch /tmp/sessin.$$; touch /tmp/sessout.$$ ) ( tail -f /tmp/sessin.$$ &; cat -u ) \ | sess "$@" | tee /tmp/sessout.$$ rm /tmp/sessin.$$ /tmp/sessout.$$ Now anything written to /tmp/sessin.$$ will be used as input to the session. The sysadmin can join a session by typing (e.g.) % tail -f /tmp/sessout.19432 &; stty -echo; cat -u > /tmp/sessin.19432 Of course, this assumes user cooperation. UNIX provides so many ways to communicate with the rest of the world that a user can probably find *some* way to execute commands unobserved if he wants. On the other hand, the admin of a pty-based system can easily make sessplex the default. Note that pty is only for BSD variants at the moment. ---Dan