怎么样在用户登陆时候显示欢迎信息!

发表于:2007-06-09来源:作者:点击数: 标签:
我看了/etc/.login文件, if(!-e.hushloginnbsp;then /usr/sbin/quota /bin/cat-s/etc/motd /etc/greetings /bin/mail-E switch($statusnbsp;case0: echo"Youhavenewmail." breaksw; case2: echo"Youhavemail." breaksw; endsw endif 修改了/etc/motd,又加了

我看了/etc/.login文件,
if (! -e .hushlogin  then
        /usr/sbin/quota
        /bin/cat -s /etc/motd
        /etc/greetings
        /bin/mail -E
        switch ( $status 
        case 0:
                echo "You have new mail."
                breaksw;
        case 2:
                echo "You have mail."
                breaksw;
        endsw
endif
修改了/etc/motd,又加了一个/etc/greetings得程序!重起但好像没有用!
请帮忙看看!
目标:
用户 telnet上来后,显示:username 您好!


 明月清风 回复于:2003-05-28 12:51:11
在/etc/profile开头增加 
ttyno=`tty|cut -c6-20` 
user=`/usr/ucb/whoami` 
grep -w $user /etc/hellousers 

创建/etc/hellousers 
内容: 
welcome user1 ! 
welcome user2 ! 
。。。 

以user1登陆,即出现welcome user1!信息,此脚本有很多漏洞,仅提供想法,可以再修改完善。

 南非蜘蛛 回复于:2003-05-28 12:52:36
在用户的登陆脚本里写几个echo。。。。就行

 monkeysun 回复于:2003-05-28 13:57:58
在/etc/issue中加入你想要的内容即可

 houji 回复于:2003-05-28 14:11:46
好用,哈哈。

 明月清风 回复于:2003-05-28 15:32:43
类似于/etc/issue功能的还有,创建
/etc/default/telnetd和/etc/defualt/ftpd
内容:
BANNER="\n*******************\n"
但这些在登陆之前就显示,登陆后并不知道谁登陆,不能显示欢迎user
的信息。除了蜘蛛说的修改每一个用户的profile,增加echo,还有没有其他一劳永逸的简便办法?

 beginner-bj 回复于:2003-05-28 18:11:44
我自己写的
cp /etc/profile /etc/profile.bak
echo echo welcome '`/usr/ucb/whoami`' >> /etc/profile

原文转自:http://www.ltesting.net