Change pre-login message in the Linux terminal Link to heading

You need to edit /etc/issue file to change a pre-login messages in the Linux Terminal

1sudo cp /etc/issue /etc/issue.orig

Character sequences to display various information (source)

  • \d - Insert the current date
  • \t - Insert the current time
  • \n - Insert the hostname
  • \l - Insert the name of the current tty line
  • \4 - Insert the machine’s IPv4 address (CentOS and Debian)

Example:

1# cat /etc/issue
2[\l] Ubuntu 20.04.2 LTS
3hostname  : \n
4address   : \4
5
6# output
7[tty1] Ubuntu 20.04.2 LTS
8hostname: 192.168.15.27
9address : websrv1

Change pre-login message in the SSH Link to heading