Skip to content

Commit eab7737

Browse files
committed
Merge pull request #1 from gabriel-samfira/master
Added script that fixes SSH authentication on ESXi
2 parents cc089d7 + a9c2711 commit eab7737

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

esxi-fix-pam-ssh-auth.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
3+
/bin/grep '^#PAMFix' /etc/rc.local.d/local.sh > /dev/null 2>&1
4+
5+
if [ $? != 0 ]
6+
then
7+
/bin/sed -i '/exit 0/d' /etc/rc.local.d/local.sh
8+
cat <<EOF >> /etc/rc.local.d/local.sh
9+
10+
for i in \$(/bin/grep "/bin/sh" /etc/passwd | cut -f1 -d":")
11+
do
12+
/bin/sed -i 's/^-:'\$i':/+:'\$i':/g' /etc/security/access.conf
13+
done
14+
15+
/bin/grep local.sh /var/spool/cron/crontabs/root > /dev/null 2>&1
16+
if [ \$? != 0 ]
17+
then
18+
echo '* * * * * /etc/rc.local.d/local.sh' >> /var/spool/cron/crontabs/root
19+
fi
20+
#PAMFix
21+
EOF
22+
fi
23+
24+
/etc/rc.local.d/local.sh
25+
/sbin/auto-backup.sh

0 commit comments

Comments
 (0)