Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: How to disable Virtual Consoles

  1. #1
    Join Date
    Oct 2012
    Location
    India
    Posts
    332

    Default How to disable Virtual Consoles

    Hi guys,

    I am using OpenSUSE 12.3 with XFCE DE.Now I want to disable virtual consoles i.e I don't want the CLI if I press CTRL-ALT-F keys.Is there a possibility to do that.


    Any help would be appreciated.Thanks in advance.

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,384

    Default Re: How to disable Virtual Consoles

    In a sysviinit system you would find in /etc/inittab:
    Code:
    # getty-programs for the normal runlevels
    # <id>:<runlevels>:<action>:<process>
    # The "id" field  MUST be the same as the last
    # characters of the device (after "tty").
    1:2345:respawn:/sbin/mingetty --noclear tty1
    2:2345:respawn:/sbin/mingetty tty2
    3:2345:respawn:/sbin/mingetty tty3
    4:2345:respawn:/sbin/mingetty tty4
    5:2345:respawn:/sbin/mingetty tty5
    6:2345:respawn:/sbin/mingetty tty6
    #
    But that is all gone in 12.3. In other words, I assume it is somewhere in systemd configurations. But we have to reinvent the wheel for all thes features now .
    Henk van Velden

  3. #3
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,079

    Default Re: How to disable Virtual Consoles

    On Fri, 02 Aug 2013 19:36:02 +0000, hcvv wrote:

    > In a sysviinit system you would find in /etc/inittab:
    >
    > Code:
    > --------------------
    > # getty-programs for the normal runlevels
    > # <id>:<runlevels>:<action>:<process>
    > # The "id" field MUST be the same as the last # characters of the
    > device (after "tty"). 1:2345:respawn:/sbin/mingetty --noclear tty1
    > 2:2345:respawn:/sbin/mingetty tty2 3:2345:respawn:/sbin/mingetty tty3
    > 4:2345:respawn:/sbin/mingetty tty4 5:2345:respawn:/sbin/mingetty tty5
    > 6:2345:respawn:/sbin/mingetty tty6 #
    >
    > --------------------
    >
    > But that is all gone in 12.3. In other words, I assume it is somewhere
    > in systemd configurations. But we have to reinvent the wheel for all
    > thes features now .


    I found this:

    http://unix.stackexchange.com/questi...wer-ttys-with-
    systemd

    Seems like it might do the trick.

    Jim



    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

  4. #4
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,769

    Default Re: How to disable Virtual Consoles

    That looks like it would do it but I don't know about 0 ttys. A tty has pulled my bacon out of the fire many time when the GUI would not start for some reason. So I'd really think about killing all of them. It is really good to have a safety net

  5. #5
    Join Date
    Oct 2012
    Location
    India
    Posts
    332

    Default Re: How to disable Virtual Consoles

    That didn't work completely.I have modified logind.conf with NAutoVFs=0 and ReserveVT=0.Now I am still unable to disable tty1.All others are disabled.

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,384

    Default Re: How to disable Virtual Consoles

    Quote Originally Posted by gogalthorp View Post
    That looks like it would do it but I don't know about 0 ttys. A tty has pulled my bacon out of the fire many time when the GUI would not start for some reason. So I'd really think about killing all of them. It is really good to have a safety net
    I have similar concerns, but on the other hand I can see a case for disabling them all for security reasons to block people from using the system for other things then a restricted environment.

    Am environment with an automatic GUI login and then restricted application usage (think about KIOSK in KDE as an example) could be circumvented by a console login.
    Henk van Velden

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,384

    Default Re: How to disable Virtual Consoles

    Quote Originally Posted by nishanth9042 View Post
    That didn't work completely.I have modified logind.conf with NAutoVFs=0 and ReserveVT=0.Now I am still unable to disable tty1.All others are disabled.
    Hm, I didn't read that link and the links mentioned there complete, but I get the impression that the first console (that is where the console messages are) allway gets a tty (and thus a login prompt) because the kernel asks for it. Thus regardless of what you configure in the systemd environment. Maybe you should look into kernel parameters to see if you can tell the kernel not to do this.


    BTW, reading this:
    There is no real need to disable "extra" TTYs as under systemd gettys are generated on demand: see man systemd-getty-generator for details
    and what follows there, shows that that the person writing this (and thus maybe also the designers of the feature) had in hisr mind only one possible reason for not wanting to have those TTYs: resources. The fact that people may want not to have them for other reason was apperently not taken into account.
    Henk van Velden

  8. #8
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,384

    Default Re: How to disable Virtual Consoles

    Found this in aq list of kernel parameters:
    Code:
    console=	[KNL] Output console device and options.
    
    		tty<n>	Use the virtual console device <n>.
    
    		ttyS<n>[,options]
    		ttyUSB0[,options]
    			Use the specified serial port.  The options are of
    			the form "bbbbpnf", where "bbbb" is the baud rate,
    			"p" is parity ("n", "o", or "e"), "n" is number of
    			bits, and "f" is flow control ("r" for RTS or
    			omit it).  Default is "9600n8".
    
    			See Documentation/serial-console.txt for more
    			information.  See
    			Documentation/networking/netconsole.txt for an
    			alternative.
    
    		uart[8250],io,<addr>[,options]
    		uart[8250],mmio,<addr>[,options]
    			Start an early, polled-mode console on the 8250/16550
    			UART at the specified I/O port or MMIO address,
    			switching to the matching ttyS device later.  The
    			options are the same as for ttyS, above.
    		hvc<n>	Use the hypervisor console device <n>. This is for
    			both Xen and PowerPC hypervisors.
    
                    If the device connected to the port is not a TTY but a braille
                    device, prepend "brl," before the device type, for instance
    			console=brl,ttyS0
    		For now, only VisioBraille is supported.
    Maybe some experimenting is needed here, but I could imagine that using a black hole device somewhere here might help.

    Happy hacking
    Henk van Velden

  9. #9
    Join Date
    Oct 2012
    Location
    India
    Posts
    332

    Default Re: How to disable Virtual Consoles

    I have tried with various kernel parameters but of no use.Unable to disable tty1.

  10. #10
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,384

    Default Re: How to disable Virtual Consoles

    Quote Originally Posted by nishanth9042 View Post
    I have tried with various kernel parameters but of no use.Unable to disable tty1.
    One must understand of course that the console login was allways a part of any Unix system as the basic (and when in trouble maybe only) way to get access to the system. Thus I can understand that it is not removable at all.

    Maybe you could explain why you want this. I have suggested something somewhere above, but you did not tell any background of your whish. Thus it could be that a different path leads to a solution.

    In other words, let us try to avoid this being a case of "describe the goal, not the step": How To Ask Questions The Smart Way
    Henk van Velden

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •