How do I disable switching to virtual terminals (TTYs) using(Ctrl+Alt+F1…F6) in Ubuntu?
Ubuntu – How to disable Virtual Consoles tty[1-6]
tty
Related Question
- Ubuntu – How to disable Caps Lock on text-mode (tty) terminals
- Ubuntu – Change Default TTY shortcut
- Ubuntu – How to change the TTY colors
- Ubuntu – Enable Ctrl+Alt+F1 Virtual Consoles in GNOME (Ubuntu 17.04+)
- Ubuntu – Kubuntu – How to remove ALT+F# keybinding to switch ttys
- Ubuntu – How to increase the number of TTY consoles
Best Answer
I found three methods. I'm listing to help others if they need:
First Method:
Second Method:
Open/create the file
/etc/X11/xorg.conf
using the following command:and add the following lines inside:
Third Method:
change
ACTIVE_CONSOLES="/dev/tty[1-6]"
to your choice. Lets say if you want only two TTY or virtual console then change toACTIVE_CONSOLES="/dev/tty[1-2]"
Comment on all the lines in
ttyX
file that you don't need. In this exampletty3-tty6
Reboot to see the change.