When I boot my system, I have 6 tty (agetty). I want to keep tt1 and disable the other ones, ie tty[2-5]. How to disable all tty but tt1?
My system is a Ubuntu 18.04 which I customized to be lighter.
I feel that I followed all answers from Ask Ubuntu without success.
What I have done already:
FollowingHow can I reduce the number of TTYs?I changed in /etc/default/console-setup
ACTIVE_CONSOLES="/dev/tty[1-6]"in
ACTIVE_CONSOLES="/dev/tty1"and deleted /etc/init/tty[2-5].conf.
Inspired by How do I increase the number of TTY consoles?, in /etc/systemd/logind.conf, I have set
NAutoVTs=1
ReserveVT=1I is worth to mention that I don't have systemd-logind.
Despite those changes, after reboot, I have 6 agetty.
Here the full output of systemctl status
State: degraded Jobs: 0 queued Failed: 7 units Since: Thu 2020-04-16 16:50:49 CEST; 1h 31min left CGroup: / ├─init.scope │ └─1 /sbin/init └─system.slice ├─irqbalance.service │ └─921 /usr/sbin/irqbalance --foreground ├─systemd-udevd.service │ └─440 /lib/systemd/systemd-udevd ├─systemd-journald.service │ └─429 /lib/systemd/systemd-journald ├─ssh.service │ ├─1116 /usr/sbin/sshd -D │ ├─1158 sshd: clement [priv] │ ├─1318 sshd: clement@pts/0 │ ├─1319 -zsh │ ├─1419 sudo systemctl status │ ├─1420 systemctl status │ └─1421 pager ├─ │ └─1019 /sbin/wpa_supplicant -s -B -P /run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -C /run/wpa_supplicant ├─lvm2-lvmetad.service │ └─433 /sbin/lvmetad -f ├─system-getty.slice │ ├─ │ │ └─1110 /sbin/agetty -o -p -- \u --noclear tty6 linux │ ├─ │ │ └─1111 /sbin/agetty -o -p -- \u --noclear tty1 linux │ ├─ │ │ └─1113 /sbin/agetty -o -p -- \u --noclear tty3 linux │ ├─ │ │ └─1109 /sbin/agetty -o -p -- \u --noclear tty5 linux │ ├─ │ │ └─1108 /sbin/agetty -o -p -- \u --noclear tty2 linux │ └─ │ └─1112 /sbin/agetty -o -p -- \u --noclear tty4 linux └─smartd.service └─919 /usr/sbin/smartd -n 1 Answer
I found an answer here The idea is to mask the extra ttys
for i in {2..6}; do systemctl mask getty@tty${i}.service
done