Ubuntu: Disable logon prompt show hostname


Per default the login prompt shows %hostname% login:.

I don't want anybody with console access to see the hostname of the server that easily.

How to get rid of the hostname there?


Add the option --nohostname to getty. Edit the files /etc/init/tty[1-9].conf to change the exec line from something like

exec /sbin/getty -8 38400 tty1  


exec /sbin/getty --nohostname -8 38400 tty1  

It may also be necessary to edit /etc/issue to remove the \n escape code, which displays the hostname before the login prompt. Change it so it looks like:

Ubuntu XX.YY \l  

Default text mode login screen:

enter image description here

Text mode login screen after adding --nohostname too /etc/init/tty*.conf and playing with /etc/issue:

enter image description here

More information:

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »