How do you change the message that appears before the login: prompt?

Note: Option a under 2 was broken for a while, but if the crypto sources are installed, the version of telnetd that results doesn't allow 2a to work. Use 2b then.

1) Create a file with the message you wish to display, say /etc/issue. Give it 644 permissions (chmod 644 issue).

2) Option a: Open (as root) /etc/gettytab with a text editor and add to the section that says "default" if=/etc/issue: and save the file. Note that the entries are separated by colons and the section ends with a colon.

2) Option b: Instead of using if as in 2a, add your message to the im variable and put a \n after it for a newline. You can do this before or after the other stuff, which determines whether it will come before or after the line listing the operating system and so forth. Be sure you don't split the "default" line into more than one line; use \r, \n, and \t to format your message. Beware pico, with its automatic wrap.

3) You should not need to get gettytab reread by restarting init, which you could do either by rebooting (a last resort) or sending init a signal to restart with kill -1 1 (init is always process 1). Note that you can't test by logging in from an existing prompt; you need to test it from the outside or by using the command telnet localhost.

4) You can also create a message attached to the P|Pc|Pc console:\ entry in gettytab with an if=etc/issuemsg: added to the next line that will show up internally.

5) It's possible to use the fortune program to change the message in the issue or issuemsg (when if works) file by running a crontab job that calls a script that writes a new message to the file periodically. The script would run the fortune program. You can create your own data base as a file from which fortune can select a message. See man fortune and man strfile.

--Annelise Anderson
andrsn@andrsn.stanford.edu