Celeb Glow
news | April 02, 2026

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?

1 Answer

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

to

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:

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy