testing
This commit is contained in:
Vendored
+4
-4
@@ -14,7 +14,7 @@ if [ $isInFile -eq 0 ]
|
|||||||
isInFile=$(cat /etc/ssh/sshd_config | grep -c "#PermitRootLogin prohibit-password")
|
isInFile=$(cat /etc/ssh/sshd_config | grep -c "#PermitRootLogin prohibit-password")
|
||||||
if [ $isInFile -eq 0 ]
|
if [ $isInFile -eq 0 ]
|
||||||
then
|
then
|
||||||
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak1
|
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak1 > /dev/null 2>&1
|
||||||
sed -i 's/PermitRootLogin no/#PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
|
sed -i 's/PermitRootLogin no/#PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
|
||||||
sed -i 's/PermitRootLogin yes/#PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
|
sed -i 's/PermitRootLogin yes/#PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
|
||||||
sed -i 's/PermitRootLogin prohibit-password/#PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
|
sed -i 's/PermitRootLogin prohibit-password/#PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
|
||||||
@@ -27,7 +27,7 @@ if [ $isInFile -eq 0 ]
|
|||||||
isInFile=$(cat /etc/ssh/sshd_config | grep -c "PasswordAuthentication no")
|
isInFile=$(cat /etc/ssh/sshd_config | grep -c "PasswordAuthentication no")
|
||||||
if [ $isInFile -eq 0 ]
|
if [ $isInFile -eq 0 ]
|
||||||
then
|
then
|
||||||
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak2
|
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak2 > /dev/null 2>&1
|
||||||
sed -i 's/#PasswordAuthentication no/PasswordAuthentication no/g' /etc/ssh/sshd_config
|
sed -i 's/#PasswordAuthentication no/PasswordAuthentication no/g' /etc/ssh/sshd_config
|
||||||
sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
|
sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
|
||||||
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
|
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
|
||||||
@@ -75,7 +75,7 @@ fi
|
|||||||
isInFile=$(cat /home/akanealw/.ssh/config | grep -c "*root")
|
isInFile=$(cat /home/akanealw/.ssh/config | grep -c "*root")
|
||||||
if [ $isInFile -eq 0 ]
|
if [ $isInFile -eq 0 ]
|
||||||
then
|
then
|
||||||
cp /home/akanealw/.ssh/config /home/akanealw/.ssh/config.bak
|
cp /home/akanealw/.ssh/config /home/akanealw/.ssh/config.bak > /dev/null 2>&1
|
||||||
mv /home/akanealw/.ssh/known_hosts /home/akanealw/.ssh/known_hosts.old
|
mv /home/akanealw/.ssh/known_hosts /home/akanealw/.ssh/known_hosts.old
|
||||||
echo "" >> /home/akanealw/.ssh/config
|
echo "" >> /home/akanealw/.ssh/config
|
||||||
echo "" >> /home/akanealw/.ssh/config
|
echo "" >> /home/akanealw/.ssh/config
|
||||||
@@ -97,7 +97,7 @@ fi
|
|||||||
isInFile=$(cat /root/.ssh/config | grep -c "*root")
|
isInFile=$(cat /root/.ssh/config | grep -c "*root")
|
||||||
if [ $isInFile -eq 0 ]
|
if [ $isInFile -eq 0 ]
|
||||||
then
|
then
|
||||||
cp /root/.ssh/config /root/.ssh/config.bak
|
cp /root/.ssh/config /root/.ssh/config.bak > /dev/null 2>&1
|
||||||
mv /root/.ssh/known_hosts /root/.ssh/known_hosts.old
|
mv /root/.ssh/known_hosts /root/.ssh/known_hosts.old
|
||||||
echo "" >> /root/.ssh/config
|
echo "" >> /root/.ssh/config
|
||||||
echo "" >> /root/.ssh/config
|
echo "" >> /root/.ssh/config
|
||||||
|
|||||||
Reference in New Issue
Block a user