sudo: Add fake version. You know why. :)
This commit is contained in:
parent
7a9de1e10d
commit
bb181cb2a9
2 changed files with 39 additions and 0 deletions
25
sudo/files/fakesudo
Normal file
25
sudo/files/fakesudo
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
trap report SIGINT SIGTERM
|
||||||
|
|
||||||
|
function askpw {
|
||||||
|
# echo -n "Password:"
|
||||||
|
read -s -p "Password:" password
|
||||||
|
password=""
|
||||||
|
echo ""
|
||||||
|
echo "Sorry, try again."
|
||||||
|
}
|
||||||
|
|
||||||
|
function report {
|
||||||
|
stty echo # Fix echo if ^C during password prompt
|
||||||
|
( whoami ; date ) | mailx -s "Someone sudo'ed (`id -un`, ${SSH_CONNECTION})" root
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function main {
|
||||||
|
for try in 1 2 3; do askpw; done
|
||||||
|
echo "sudo: 3 incorrect password attempts"
|
||||||
|
report
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
|
@ -37,6 +37,20 @@ class sudo {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Install fake sudo
|
||||||
|
#
|
||||||
|
class sudo::fake {
|
||||||
|
|
||||||
|
file { "/usr/bin/sudo":
|
||||||
|
ensure => present,
|
||||||
|
mode => 0555,
|
||||||
|
owner => "root",
|
||||||
|
group => "root",
|
||||||
|
source => "puppet:///modules/sudo/fakesudo",
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
# Add sudoer.
|
# Add sudoer.
|
||||||
#
|
#
|
||||||
# === Parameters
|
# === Parameters
|
||||||
|
|
Loading…
Add table
Reference in a new issue