I guess you are using xorg. man xorg says that there is an option in serverflags section which disables this functionality.
Option "DontVTSwitch" "boolean"
So you could add a section into xorg.conf or xorg.conf.d/

Artur

Ian Zimmerman writes:

On 2019-07-10 20:44, François-Xavier CARTON wrote:

> On 7/10/19 7:03 PM, Ian Zimmerman wrote:
> > Here is my next "low information" question, haha.
> >
> > I use i3lock which is like Xscreensaver but much much simpler; it plays
> > no movies or games, just blanks the screen with a configured color or
> > image.  To unlock it you have to type your password.
> >
> > It bothers me that even when i3lock has locked the X session, I can
> > still switch to other Linux virtual consoles with Alt-Control-F<n> ,
> > without typing the password.  It so happens that on one of the other
> > virtual consoles there is often an interactive root shell :-P
> >
> > So, is it possible to prevent virtual console switching while the X
> > screen is locked, but still allow it at other times?  Looks like
> > something the locker program would have to do, not the X server; but
> > again I don't know much about this stuff.
> >
>
> Not a direct answer to your question, but as a workaround you can use
> tmux sessions, and simply detach them and logout when you lock your
> computer.

I could also just log out directly :-)  It's not like I have some
context in the shell that I want to keep.  It is just there when I want
to be root.

> Also, if this is just a shell to start the X server, you can launch it
> as "startx & bg; disown" and then logout.

No, it's my way to run things as root, in general.  I distrust su, sudo
and friends.

--
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet and on broken lists
which rewrite From, fetch the TXT record for no-use.mooo.com.


Reply via email to