Assume I start an X server manually from a virtual console
startx, with the line
id:3:initdefault: set in
/etc/inittab. The X server gets run and put on another virtual console, normally being
/dev/tty7. After some time I decide to lock the screen with
xscreensaver --lock and leave my computer. To unlock the screen one would have to know my user's password.
If someone now decides to kill the running X server, he or she would be returned to the shell running at
/dev/tty1 and pretty much have access to my computer. Typically, the X server can be killed with
Ctrl+Alt+Backspace or switching to the initial console and
SIGTERM the running process with
This is trivial to do - which means there must be trivial ways to prevent it from happening. I'm using
vlock to lock my virtual console
/dev/tty1 to prevent this:
$ xinit && vlock || vlock
What other methods are there to prevent this kind of access to virtual consoles from X sessions? Is the above method safe enough? How do you prevent this on your system? I'm not going to use a display manager.