| Server IP : 172.67.178.83 / Your IP : 216.73.217.141 Web Server : Apache System : Linux hosting01.arsenalhost.com 4.18.0-425.13.1.lve.el8.x86_64 #1 SMP Mon Feb 27 15:23:24 EST 2023 x86_64 User : corbizre ( 1013) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/pam_lve/scriptlets/ |
Upload File : |
#!/bin/bash
# RPM post script
# Note: Also called from Debian pam-lve.postinst scriptlet
# RPM arguments:
# "$1" == 0 -- RPM uninstall package ???
# "$1" == 1 -- RPM upgrade/downgrade package ???
# DEB arguments:
# "$1" == "configure" - DEB install package
# "pam-lve POST INSTALL STARTED"
# RPM/DEB argument unified interpreter
argument=''
if [[ "$1" == 1 || "$1" == "configure" ]]; then
# "$1" == 1 -- RPM upgrade/downgrade package
# "$1" == "configure" -- DEB
argument='upgrade'
else
# Unknown argument (some special cases only for DEB. See pam-lve.postinst scriptlet for details),
# skip all actions
exit 0
fi;
# add pam without securelve in pam configs
if [ "$argument" == 'upgrade' ]; then
if [ -e /etc/pam.d/sudo ]; then
grep -q pam_sulve.so /etc/pam.d/sudo
if [ $? -eq 1 ]; then
echo "session required pam_sulve.so" >> /etc/pam.d/sudo
fi
fi
grep -q pam_sulve.so /etc/pam.d/su
if [ $? -eq 1 ]; then
grep -q pam_lve.so /etc/pam.d/su
if [ $? -eq 1 ]; then
echo "session required pam_sulve.so" >> /etc/pam.d/su
else
sed -i '/pam_lve.so/i \session required pam_sulve.so' /etc/pam.d/su
fi
fi
grep -q pam_lve.so /etc/pam.d/sshd
if [ $? -eq 1 ]; then
echo "session required pam_lve.so 500 0" >> /etc/pam.d/sshd
fi
grep -q pam_lve.so /etc/pam.d/su
if [ $? -eq 1 ]; then
echo "session required pam_lve.so 500 0" >> /etc/pam.d/su
fi
# PAM config for cron
pam_d_cron_file=''
if [ -e "/etc/pam.d/crond" ]; then
# Cloudlinux
pam_d_cron_file='/etc/pam.d/crond'
fi
if [ -e "/etc/pam.d/cron" ]; then
# Ubuntu
pam_d_cron_file='/etc/pam.d/cron'
fi
if [ -n "$pam_d_cron_file" ]; then
grep -q pam_lve.so "$pam_d_cron_file"
if [ $? -eq 1 ]; then
echo "session required pam_lve.so 500 0" >> "$pam_d_cron_file"
fi
fi
fi
# "pam-lve POST INSTALL FINISHED"
exit 0