changing the pre-login text – also known as /etc/issuePre-login text appears at the start of your telnet session. It looks something like this:
FreeBSD (ns.freebsd.nz.eu.org) (ttyp2) login:
You can then enter your user id and password. Please don’t confuse this with the post-login text, otherwise known as the Message Of The Day (motd).
You will notice that the message contains information about the operating system and the terminal. It is considered by some that such information should not be given out. If someone is scanning IP addresses for a telnet prompt, if they know the type of system they’ve found, then they’re that much further ahead. I’ve recently changed my system so that this information is not given out.
This topic started when Rzzo (Baris D. Bal) on #freebsd undernet said he was looking to change the pre-login text. I searched the mailing list archives and found the information and passed it to him. He got it to work but I couldn’t. Eventually, we figured out what was wrong.
default:\ :cb:ce:ck:lc:fd#1000:im=\r\n\r\nFreeBSD (%h) (%t)\r\n\r\n:sp#1200:
Being a cautious person, I saved the original line in case I screwed up. Here’s what I put for my first attempt:
default:\ #:cb:ce:ck:lc:fd#1000:im=\r\n\r\nFreeBSD (%h) (%t)\r\n\r\n:sp#1200: :cb:ce:ck:lc:fd#1000:im=\r\n\Hello. Welcome to the box.\r\n\r\n:sp#1200:
Then I tried to reconnect. No change in the prompt. I looked at lots of things, I couldn’t get it to work. After several false starts, it clicked. You can’t have a # after the default. See the next section for what you should have:
SuccessHere’s what you need to put in. I kept the comment line so I knew what the original code contained. Note that %h = hostname and that %t is the terminal. You can’t have a comment (i.e. #) right after the default line.
firstname.lastname@example.org>. Thanks Philip for pointing this out to me.default:\ :cb:ce:ck:lc:fd#1000:im=\r\n\Hello. Welcome to the box.\r\n\r\n:sp#1200: #:cb:ce:ck:lc:fd#1000:im=\r\n\r\nFreeBSD (%h) (%t)\r\n\r\n:sp#1200:
If you want to remove the pre-login text, just modify /etc/inetd.conf and add the -h option for telnetd. Here’s what that line looks like on my 3.2-RELEASE test box:
telnet stream tcp nowait root /usr/libexec/telnetd telnetd -h
And from man telnetd you find this:
-h Disable the printing of host-specific information before login has been completed.
Remember to HUP inetd to invoke these changes.