Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have set up a kiosk system with Linux Debian Wheezy. After booting a user gets logged in automatically, executing startx through /etc/inittab.

Problem is that people could shutdown the machine or pull the power cord due to physical access and could gain a user shell by pressing CTRL-C during init.

Is it possible to disable keyboard shortcuts like CTRL-C during the init process, until the user session starts and if so how?

share|improve this question
I don't know of a way to disable ctrl-c because it is a keyboard interrupt. You may be able to hack the kernel to disable keyboard interrupts, but that would hardly fix the issue. A user with direct access could stop in the bootloader and add init=/bin/sh to the end of the boot parameters to stop the kernel boot early on. They could then remount the filesystem as read/write and modify anything they wanted on the disk. I think a better solution would be to see if you can enable silent booting so that users are unaware the system is booting until startx runs or something like that. – sbtkd85 Feb 14 '13 at 16:36
Well I thought, there'd be like a setting in /etc/inittab or so. But maybe I found a workaround, I could change the intr key stty intr ^U, ok you still could try out every key, but maybe combinations would be possible. I'll give it a try. – JohnnyFromBF Feb 14 '13 at 17:14
If that works, try stty intr undef. – Scott Feb 15 '13 at 3:49
It would work, but obviously after a reboot the setting is gone. I tried to put stty intr undef in .bashrc but on the kiosk system it won't work. Are there any other places I could put stty intr undef to? Maybe in /etc/inittab? – JohnnyFromBF Feb 15 '13 at 11:00
up vote 0 down vote accepted

I found out that by putting stty intr undef in ~/.bashrc it works perfectly on my Desktop Kubuntu machine. However it did not work for the kiosk system. Probably because of the customized way of automatic login and session start.

share|improve this answer

It may be simpler to boot into "runlevel 5" GDM/XDM and create a guest account.

Apart from that you could modify the boot script (kernel) to run certain commands (stty and what not). You would have to figure out what kind of boot system the kiosk system is based on to do that.

There is also the option to build keyboard support as a module and load it only after the X session is started. This seems like this simplest option.

By the way, whatever is executed from inittab is executed via the init script as root. Running startx as the superuser is not something you want to do on a public browser.

share|improve this answer
The only thing that gets started out of /etc/inittab is an autologin for the kiosk user: 1:2345:respawn:/sbin/getty -n -l /usr/sbin/autologin 38400 tty1 Afterwards the process startx is automatically started through an entry in /home/kiosk/.bash_profile so this seems to be pretty secure, in case no one can interrupt the start of the X session. The init process can't be interrupted, as far as i know. – JohnnyFromBF Feb 19 '13 at 8:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .