Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Disable swtichting to terminals TTYs using(Ctrl+Alt+F1...F6) in Ubuntu?!

share|improve this question
1  
I guess you should take a look at this answer to How can I reduce the number of TTYs? –  arsaKasra Oct 12 '13 at 7:40
    
@arsaKasra: Thanks –  Ask Oct 12 '13 at 7:45

4 Answers 4

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

Source: [all variants] How to disable CTRL ALT F1 - ubuntuforums.org

share|improve this answer
6  
Note that once in a while, when X11 gets stuck, those keys allow you to get out to a console and cleaning shutdown your system... I used that many times although these days I have a lot less problems with X11 getting stuck! –  Alexis Wilke Oct 12 '13 at 8:02
up vote 5 down vote accepted

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

First Method:

sudo mv /etc/init/tty*.conf /etc/init/tty*.conf.bak

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 -s

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.

share|improve this answer
sudo rm /etc/init/tty*.conf

This will totally remove the ttyX conf file and thus you will not be able to use it :)

NB: you can't be able to restore it later on

share|improve this answer

open the tty conf in the /etc/init/ directory

comment out those lines in the ttyX.conf files:

#respawn 
#exec /sbin/getty -8 38400 ttyX

Exmaple to disable tty1:

sudo gedit /etc/init/tty1.conf

Then edit by inserting # in front of the commands

#respawn 
#exec /sbin/getty -8 38400 tty1

Save and Reboot

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.