From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,fbcc21bb2af609d0,start X-Google-Attributes: gid10d4db,public X-Google-ArrivalTime: 1994-11-21 00:16:19 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!pipex!sunic!news.funet.fi!hydra.Helsinki.FI!news.helsinki.fi!not-for-mail From: carl@inbe.net (Carl Declerck) Newsgroups: comp.os.linux.announce Subject: ttysnoop 0.12 is now on sunsite + FAQ Followup-To: comp.os.linux.admin Date: 20 Nov 1994 19:38:53 +0200 Organization: INnet NV Sender: wirzeniu@cc.Helsinki.FI Message-ID: <3ao1je$f52@klaava.Helsinki.FI> NNTP-Posting-Host: klaava.helsinki.fi Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Keywords: ttysnoop, terminal, sysadmin, privacy I've just put ttysnoop 0.12 on sunsite. This version has been around for a while but I noticed nobody had it yet, so here it is. :) This version has one new feature. It allows you to suspend/resume snooping with a single keypress. Below are the README and brandnew FAQ-list. -------------------------------------------------------------------- README for ttysnoop 0.12 (alpha) -- 06-09-94 This is version 0.12 of ttysnoop for Linux. It introduces one new feature and now also has support for shadow passwords. (Thanx to those who mailed me the patches) The package 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. To install, untar the archive, customize Makefile and config.h and type 'make'. If all goes well, type 'make install' next and copy the example snooptab.dist file to /etc/snooptab. Edit this new copy and tell your getty/telnetd to execute /sbin/ttysnoops as the login program (instead of /bin/login). You should then be able to snoop upon the tty's listed in /etc/snooptab whevener a user logs in on them. Mail any bug-reports/patches/comments to carl@miskatonic.nfe.be or carl@p10.f500.n292.z2.fidonet.org. History log: >>From v0.11 onwards, user authentication is performed via a password prompt whenever snooping is done through a pty. >>From v0.12 onwards, the ttysnoop client supports a suspend/resume key (default ctrl-\) which suspends/resumes snooping when it is pressed. Might come in handy when snooping rz/sz sessions. ;) +-------------------------------------------------------------------+ | Smallish FAQ-list for the ttysnoop package. Last update 19-11-94. | +-------------------------------------------------------------------+ I started putting this together after receiving lots of similar questions on ttysnoop and how to set it up. Here goes... Q : What is ttysnoop? A : Good question. It's a little tool that allows system administrators (or any other authorised persons) to watch, spy, snoop or whatever you want to call it, on user-logins. These logins can be either through a dial-in line (modem) or from the network (telnet session). Technically, this is what it actually does: A 'server', called ttysnoops, is run right after getty or telnetd has accepted the user's login name, but usually even before /bin/login is executed. The server creates a pseudo-tty and runs any subsequent processes in the login-chain as slaves to this pty. The server then continually passes any slave IO from/to the other end of the connection (ie. the unsuspecting user :) as well as to a snoop-device (ie. the snooping sysadmin). Q : There's a ttysnoops binary and a ttysnoop binary. What's the difference? A : ttysnoops with an s is the server. It is always used when snooping on a user. See the technical answer to question 1. The other one, ttysnoop without an s, is the client. It is only needed by the snooper when snooping through a socket (see further). It accepts one argument and that is the leafname (as reported by the commands 'w' or 'who') of the pseudo-tty to snoop. Q : In the docs you say "tell your getty/telnetd to start /sbin/ttysnoops instead of /bin/login." How do I do that? A : This is by far the most frequently asked question. Let's start with getty. If you're using getty_ps, like I am, go to the /etc/default directory and edit the file(s) uugetty.ttySx, where x is the logical com-port number of your dial-in line(s). Put the line LOGIN=/sbin/ttysnoops somewhere at the top. This 'tells' uugetty to execute the ttysnoops server instead of the default /bin/login. If you're using mgetty, edit the file called login.config, which is probably in /usr/local/lib/mgetty and add the following line: * - - /sbin/ttysnoops @ This will make mgetty start the ttysnoops server when a user logs in. Read the mgetty documentation to find out what exactly is happening. Telling telnetd how to start ttysnoops is a bit trickier and probably depends on what 'flavour' of telnetd you're running. The ones I've seen don't have these nice runtime config files and should be modified at the source code level. So grab your telnetd's sources and look for lines that have got the string "/bin/login" in them. Change all of these into "/sbin/ttysnoops" and recompile & install the new telnetd. An alternative way to get snooped logins is to rename the existing /bin/login to something like /bin/login.snooped and rename /sbin/ttysnoops to /bin/login. If you choose to do it like this, change all occurences of /bin/login in /etc/snooptab to /bin/login.snooped. This method may be a bit easier to install but it will snoop *ALL* logins, including those from virtual consoles, which is something you may not want to do. Q : How do I set up /etc/snooptab? I'm confused. A : It's all fairly simple really. The snooptab file is used by ttysnoops so that it knows how to snoop on logins on a specific dial-in line (or telnet connection). The first field on each line tells us the name of a line we want to snoop, for example ttyS3 (don't include the /dev/ prefix). The next field tells us 'where' (or how) we want to snoop on this line. Just give the full pathname of a device (or even file) through which you want to see what the user is doing. This is usually an unused virtual console, like /dev/tty7 or /dev/tty8, but could just as well be another serial line, a file, a printer or whatever as long as it's a character device. There is an exeption to this and that is if you don't want to permanently snoop on a user but only, say, if you really think he's being naughty. This is when you want to snoop 'through a socket' with the ttysnoop client. In this case, put the literal string "socket" in the second field. The third field is currently not really important and is best left as "login". The last field is the program that should be executed once the ttysnoop server has begun snooping this login, and usually is the standard login program /bin/login (or /bin/login.snooped if you chose for the alternative ttysnoop installation). That's it basically. Include an entry for each dial-in line you want to snoop. But what if a user logs in from the network? In that case, the login 'line' will be a pseudo-tty (pty) and will be called something like ttyp4. Because you generally don't know beforehand which pty will be allocated during a network login, you can put the '*' wildcard as the *LAST* entry in your snooptab and it will match any login 'line'. Note that this last entry also better had a "socket" snoop device since LOTS of network logins might occur and couldn't all be snooped simultaneously through, say, /dev/tty8. On lots of systems, the only entry in snooptab is just the wildcard-line. Q : Ttysnoop works ok, but sometimes after users have logged out, they are still visible with 'w' or 'who'. What's up? A : I don't know. Some people have reported this and it does seem to be a ttysnoop related problem, but unless you give me the exact details of your setup, ie. getty package & version, ttysnoop version, dial-in or network login, etc... I cannot track down the problem. I *DO* know there is/was a problem with older versions of getty_ps because I had it myself but it suddenly disappeared after upgrading various programs. So if you have the problem and it is persistent, even after upgrading to the most current versions of all programs involved, send me a _detailed_ problem report so I can investigate the problem. Q : I adore ttysnoop, I also want to use it on my $100000000 Cray thingy. Has it been ported to any other platforms? A : Lots of people seem to ask this. I can't really help unless I have access to such a platform. Currently the only other-than-Linux version is a BSDI one, which still has a nasty bug that needs to be fixed. I would love to receive patches with support for other systems so I can include them in the main archive. If you have done any porting, please send me the patches so that other people may benefit from your work. Q : What's the current version of ttysnoop? A : At the time of writing, it's v0.12. --- ooo OOO ooo --- Carl Declerck. carl@INbe.net carl@miskatonic.nfe.be