1837085 Members
2523 Online
110112 Solutions
New Discussion

system logon message

 
rccmum
Super Advisor

system logon message

I am looking for scripting a logon message which would appear on console or telnet, ssh session showing "hostname" in bold/color characters and will show if the system is a production or dev/test system showing "production/Dev" in BOLD,big character size and blinking text.

Does anyone has such thing in place?

In OpenVMS it's possible and I want to do similar or more on HPUX.

Thanks in advance
4 REPLIES 4
Tim Nelson
Honored Contributor

Re: system logon message

You can modify the /etc/issue and configure the telnet daemon with -b option in /etc/inetd.conf to use that for initial welcome screen.

I believe that you can do the same for ssh welcome and etc...

sparky_2
Frequent Advisor

Re: system logon message

You can edit individual .profile settings or the /etc/profile to set things such as your prompt (eg. export PS1="$(uname -n)"). Edit your motd to specify whether the system is prod/dev, etc. You can use tput commands to set things such as bold/blinking typeset. Do a man on terminfo for the various options.
A. Clay Stephenson
Acclaimed Contributor

Re: system logon message

Get used to disappointment. While in principle, it would be possible to embed the terminal escape sequences in /etc/issue to blink -- the problem is which escape sequences. If you got it to work with one terminal model, you would have no assurance that this would work for another terminal sequence --- and it's much to early in the login sequence to know what kind of terminal you are using.

A reasonable approach would do something like this:

banner $(hostname) > myfile
banner "Prod" >> myfile

cat myfile >> /etc/issue

This would append the hostname and "Prod" in very large characters to the file /etc/issue. If, for exanmple, you then add -b /etc/issue to the telnetd command in /etc/inetd.conf and then do an inetd -c, you should see the banner.
If it ain't broke, I can fix that.
Doug Burton
Respected Contributor

Re: system logon message

For ssh edit the "#Banner /some/path" line in the /opt/ssh/etc/sshd_config file to "Banner /etc/issue".

For ftp add "-l -a" to the end of the ftp line in the /etc/inetd.conf file.

For telnet add "-b /etc/issue" to the end of the telnet line in the /etc/inetd.conf file.

For rlogin add "-l -B /etc/issue" to the end of the login line in the /etc/inetd.conf file.

If you use CDE then add the following lines to /etc/dt/config/Xsession.d/0091.dthello:

#!/usr/bin/ksh
dtstart_hello[0]="/usr/dt/bin/dthello -file /etc/issue &"

Then run this command:
chmod 755 /etc/dt/config/Xsession.d/0091.dthello

After all that change your /etc/issue file at will manually or with a script. Color, bold text, etc. depends on the term your using and would be placed into the issue file.