Skip to contentSkip to conversation

inittab ctrlaltdel

DISCUSSION David Eduardo Gomez Noguera 2 participants 2 messages Jul 9, 2003 – Jul 10, 2003

lore
Share & tools
lore
#0 lore raw

Hello.
I am trying to get linux to ask me for a password when I press ctr+alt+del on the console, but have been unsuccessfull... the nearest I have got to is to have a user with "/sbin/shutdown now " as the shell, and use this line in inittab

ca::ctrlaltdel:/bin/login shutdown

but that wont work.

any suggestions please?

#1 lore raw
Quoted 10 lines · David Eduardo Gomez Noguera

I am trying to get linux to ask me for a password when I press ctr+alt+del on the console, but have been unsuccessfull... the nearest I have got to is to have a user with "/sbin/shutdown now " as the shell, and use this line in inittab

ca::ctrlaltdel:/bin/login shutdown

but that wont work.

any suggestions please?

To interact with a user, you need a terminal, but init doesn't have a controlling terminal, nor do the processes which it spawns.

You would need to explicitly obtain a terminal, e.g. using a getty program (mingetty, agetty etc). As a rough guide:

ca::ctrlaltdel:/sbin/agetty -n -i -l /sbin/my_shutdown tty11

where /sbin/my_shutdown is a script along the lines of:

	#!/bin/sh
	/usr/bin/switchto 11
	exec /bin/login shutdown

Note: none of the above has been tested.

Signature · 1 line
Glynn Clements <[email protected]>