added check for backupserver
This commit is contained in:
29
debian/debian-essentials.sh
vendored
29
debian/debian-essentials.sh
vendored
@@ -405,18 +405,21 @@ systemctl restart sshd
|
||||
|
||||
|
||||
# lock root
|
||||
if [[ -d /home/akanealw ]]
|
||||
isInFile=$(cat /etc/hostname | grep -c "BackupServer")
|
||||
if [ $isInFile -eq 0 ]
|
||||
then
|
||||
isInFile=$(cat /etc/shadow | grep -c 'root:!')
|
||||
if [ $isInFile -eq 0 ]
|
||||
then
|
||||
passwd -l root
|
||||
skill -KILL -u root
|
||||
exit
|
||||
else
|
||||
echo "root account already locked."
|
||||
exit
|
||||
fi
|
||||
else
|
||||
echo "akanealw account not found, not locking root."
|
||||
if [[ -d /home/akanealw ]]
|
||||
then
|
||||
isInFile=$(cat /etc/shadow | grep -c 'root:!')
|
||||
if [ $isInFile -eq 0 ]
|
||||
then
|
||||
passwd -l root
|
||||
skill -KILL -u root
|
||||
exit
|
||||
else
|
||||
echo "root account already locked."
|
||||
exit
|
||||
fi
|
||||
else
|
||||
echo "akanealw account not found, not locking root."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user