inittab ctrlaltdel
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?
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/shutdownnow " as the shell, and use this line in inittabca::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]>