PermitRootLogin yes should go to /etc/ssh/sshd_config

This commit is contained in:
ahmadbilalkhalid 2019-08-23 11:12:57 +00:00
parent a994b4cf1a
commit d7ada99c7a

View file

@ -16,6 +16,7 @@ rdnssd -u root -r /etc/resolv.conf
ssh_authorized_keys_path='/root/.ssh/authorized_keys' ssh_authorized_keys_path='/root/.ssh/authorized_keys'
ssh_config_path='/etc/ssh/ssh_config' ssh_config_path='/etc/ssh/ssh_config'
sshd_config_path='/etc/ssh/sshd_config'
# Initial Package Intallation # Initial Package Intallation
if [ [ $(get_distro) = "alpine" ]; then if [ [ $(get_distro) = "alpine" ]; then
apk update apk update
@ -26,8 +27,8 @@ if [ [ $(get_distro) = "alpine" ]; then
echo "PasswordAuthentication no" >> $ssh_config_path echo "PasswordAuthentication no" >> $ssh_config_path
fi fi
if ! grep -q "PermitRootLogin yes" $ssh_config_path; then if ! grep -q "PermitRootLogin yes" $sshd_config_path; then
echo "PermitRootLogin yes" >> $ssh_config_path echo "PermitRootLogin yes" >> $sshd_config_path
fi fi
service sshd restart service sshd restart
else else