Results 1 to 2 of 2
I'm new to scripting and I'd like to write a script (preferably BASH) that when a user with sudo rights types "sudo <command>" he is then automatically prompted with the ...
- 07-21-2011 #1Just Joined!
- Join Date
- Jul 2011
- Location
- Las Vegas NV
- Posts
- 7
Automatic logger prompt when using sudo su-
I'm new to scripting and I'd like to write a script (preferably BASH) that when a user with sudo rights types "sudo <command>" he is then automatically prompted with the logger to comment why he is using sudo, and then prompted for his password. Any ideas on where to start?
- 07-21-2011 #2Just Joined!
- Join Date
- Jun 2011
- Posts
- 30
Maybe a little beside the point, but I suggest to create an alias named 'sudo' that launched the new created script and not to rename the binary 'sudo'. Because it can cause problems if you update the 'sudo' package (with yum or for a new linux release). In your script call the binary 'sudo' with its full pathname '/usr/bin/sudo'.
Tip for your BASH script use 'readarray' or 'read' (see man read).


Reply With Quote