Hello all. Thank you for reading.
I’m hoping someone can point me in the right direction here. I am looking to implement a wrapper script/utility that will prompt for a ticket number before running certain commands. I’ve used similar scripts in the past on systems that I didn’t have admin access.
The wrapper would do something like this:
[root@vm-helios-019] shutdown -h now
*** WARNING ***
You are attempting to shutdown a production server:
Please enter the Change Log Ticket for shutdown CHG-FL-102122
Please confirm by entering your login password: xxxxxxxxxxxxxxxxxx
Ticket number CHG-GL-102122 for user Kwan Lowe (klowe) has been logged at
Sun Feb 4, 2001 at 14:23 (2:23PM).
Ideally this would only kick in if the request is coming from an interactive session.
Thinking about it, just replacing the command with a wrapper could cause other problems.
Has anyone done anything similar?