Updated: 28 September 2026 · Applies to: systemd-logind (systemd 252 to 259) on AlmaLinux and Rocky Linux 9 and 10, RHEL 9 and 10, Ubuntu 24.04 and 26.04, Debian 13
A Linux server offers several text consoles (virtual terminals tty1 to tty6), which you switch between with Alt+F1 to Alt+F6 on the physical or IPMI console. Some security policies require only one login console. On current systems, systemd starts these consoles on demand: a login prompt appears only when you switch to that terminal, controlled by the NAutoVTs setting of systemd-logind (default 6). The /etc/inittab and /etc/sysconfig/init settings from CentOS 6 guides no longer apply.
Allow only tty1
- Create
/etc/systemd/logind.conf.d/one-tty.conf(create the folder withmkdir -p /etc/systemd/logind.conf.d):[Login] NAutoVTs=1 ReserveVT=1
NAutoVTs=1starts a login prompt automatically only on tty1.ReserveVT=1keeps tty1 reserved for it. - Apply it. Restarting logind can end graphical sessions, so on a server with a desktop, reboot instead:
systemctl restart systemd-logind
- Check: pressing Alt+F2 on the console now shows an empty screen instead of a login prompt.
Disable a specific console completely
systemctl mask getty@tty2.service
Undo with systemctl unmask getty@tty2.service. Getty services that are already running keep running until you stop them or reboot.
Serial consoles are separate
A serial console (for example ttyS0 for IPMI Serial-over-LAN) has its own service, serial-getty@ttyS0.service, and is not affected by NAutoVTs. Leave it enabled if you rely on it for out-of-band access.
SSH is not affected
These settings only change local console logins. Remote logins over SSH use pseudo-terminals and work as before.
Official documentation: logind.conf.