testing configure ssh script
This commit is contained in:
27
debian/debian-configure-sshd.sh
vendored
Normal file
27
debian/debian-configure-sshd.sh
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
isInFile=$(cat /etc/hostname | grep -c "proxmox")
|
||||||
|
if [ $isInFile -eq 0 ]
|
||||||
|
then
|
||||||
|
isInFile=$(cat /etc/ssh/sshd_config | grep -c "#PermitRootLogin prohibit-password")
|
||||||
|
if [ $isInFile -eq 0 ]
|
||||||
|
then
|
||||||
|
sed s/PermitRootLogin yes/#PermitRootLogin prohibit-password/g > /etc/ssh/sshd_config
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
isInFile=$(cat /etc/hostname | grep -c "proxmox")
|
||||||
|
if [ $isInFile -eq 0 ]
|
||||||
|
then
|
||||||
|
isInFile=$(cat /etc/ssh/sshd_config | grep -c "PasswordAuthentication no")
|
||||||
|
if [ $isInFile -eq 0 ]
|
||||||
|
then
|
||||||
|
sed s/#PasswordAuthentication yes/PasswordAuthentication no/g > /etc/ssh/sshd_config
|
||||||
|
fi
|
||||||
|
fi
|
||||||
2
debian/debian-essentials.sh
vendored
2
debian/debian-essentials.sh
vendored
@@ -6,7 +6,7 @@ if [ "$EUID" -ne 0 ]
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# autoreply config update dialog with no
|
# autoreply config update dialog with default answer no
|
||||||
if [[ ! -f /etc/apt/apt.conf.d/local ]]
|
if [[ ! -f /etc/apt/apt.conf.d/local ]]
|
||||||
then
|
then
|
||||||
echo "Dpkg::Options {" >> /etc/apt/apt.conf.d/local
|
echo "Dpkg::Options {" >> /etc/apt/apt.conf.d/local
|
||||||
|
|||||||
Reference in New Issue
Block a user