Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
29
rated 0 times [  29] [ 0]  / answers: 1 / hits: 54025  / 3 Years ago, sat, may 15, 2021, 2:18:02

How do I disable switching to virtual terminals (TTYs) using(Ctrl+Alt+F1...F6) in Ubuntu?


More From » tty

 Answers
2

I found three methods. I'm listing to help others if they need:



First Method:



sudo tee -a /etc/init/tty{1..6}.override <<<"manual"


Second Method:



Open/create the file /etc/X11/xorg.conf using the following command:



sudo -i gedit /etc/X11/xorg.conf


and add the following lines inside:



Section "ServerFlags"
Option "DontVTSwitch" "true"
EndSection


Third Method:



sudo -i

vi /etc/default/console-setup


change ACTIVE_CONSOLES="/dev/tty[1-6]" to your choice. Lets say if you want only two TTY or virtual console then change to ACTIVE_CONSOLES="/dev/tty[1-2]"



cd /etc/event.d


Comment on all the lines in ttyX file that you don't need. In this example tty3-tty6
Reboot to see the change.


[#29058] Saturday, May 15, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
percol

Total Points: 493
Total Questions: 116
Total Answers: 107

Location: Taiwan
Member since Mon, Sep 6, 2021
3 Years ago
;