作為系統管理員,有時候需要進行系統緊急維護,但系統用戶眾多, 很難一一通知,即使可以通過使用wall等命令發消息給用戶,但如果碰到用戶不在電腦前就比較麻煩了. 為此,多番尋找可以遠程控制登錄用戶的軟件,終於發現了SPY文件系統
SPY的英文說明:
SPY is a suite of programs that allows you to passively and silently observe what users are typing on the system. You can observe each keystroke, the entire screen as they see it being drawn, or even inject keys into their program as if they typed it. A special mode allows you to observe the complete contents of any multiscreen on the system, with or without 6845 attribute bytes, allowing color, underline, or blink information on the other tty to be shown as well.
SPY is completely passive to the user and program and runs under any tty device (console, serial, pseudo, etc.). SPY cannot monitor a console that is in graphics mode.
SPY is implemented as an SVR3 filesystem for Open Server Release 5.0, dynamically creating all necessary directories and files. This allows standard UNIX tools like cat, dd, hd, etc. to use all of SPY's features and allows you to write your own custom tools. Most of SPY's features can even be used across NFS, allowing for remote monitoring and controlling of programs and users from another machine.
注意:
安裝後千萬不要未經告知遠程控制同事使用的機器,尤其是有心髒問題的同事,切記! 僅在SCO OpenServer 5.0.4上測試通過,其它版本請自己測試.
請先在非正式使用服務器上測試,一切後果,概不負責!
安裝步驟:(需要以root用戶登錄)
1) 解壓縮:
uncompress tls604.tar.Z
tar xvf tls604.tar
(當前目錄下分別生成spyfs-1.1、arpwatch、dumpscreen、
sockinfo、tcpdump等目錄)
2) 安裝:
cd spyfs-1.1
(為保險起見,請先閱讀README)
# ./installit
Installing the SPY package
Installing new header files
Installing new command files
Installing SPY driver files
SPY installed. You still need to relink a new kernel and reboot.
After this message, relink your kernel, answering 'y' to everything.
# /etc/conf/cf.d/link_unix
關閉系統重新啟動,如果安裝正常,啟動時有以下信息:
fsstat: SPY filesystem unmounted and ok
fsstat: mounted /spy
3) 使用:
監控終端: spyon
usage: spyon [options] name:number
or : spyon [options] ttyname
where options are any of the following:
-r show raw queue contents and quit
-c show canonical queue contents and quit
-o show output queue contents and quit
-a show all 3 queue contents and quit
-l list available spynames for using 'name:number' format
-m mountpoint use this mountpoint instead of /spy
-z use with -r, -c, or -o: don't quit
還有spysend、spycons、spycontrol等命令。