127.0.0.1 local 134.33.86.13 jnzy.jndx.com 134.33.86.17 root2 134.33.86.18 root3
2. 写一段程序放入文件/.profile中
: # @(#) root.profile 68.1 98/01/20 # # Copyright (C) 1989-1998 The Santa Cruz Operation, Inc. # All Rights Reserved. # The information in this file is provided for the exclusive use of # the licensees of The Santa Cruz Operation, Inc. Such users have the # right to use, modify, and incorporate this code into other products # for purposes authorized by the license agreement provided they include # this notice and the associated copyright notice with any such product. # The information in this file is provided "AS IS" without warranty. # TY=`tty|cut -b 9-12` WH=`finger|cut -b 32-79|grep "$TY"|cut -b 29-39` KK=`tty|cut -b 6-9` if [ "$KK" = "ttyp" ] then WH=$WH else WH="local" fi trap 1 2 3 9 15 if [ "$WH" = "local" -o "$WH" = "root2" ] then
# set terminal type eval `tset -m scoansi:${TERM:-scoansi} -m :?${TERM:-scoansi} -e -r -s -Q` export TERM PATH SHELL HOME
[ -x /bin/mesg ] && mesg n # if mesg is installed... date else echo "you can not telnet by root:77" #拒绝登录并响铃告警 echo "press any key to exit"#按任意键退出 read sad exit fi