Fix bug in Stretch builds. sshd_config no longer contains

PermitRootLogin. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=852781
This commit is contained in:
Zach Marano 2017-03-27 17:12:04 -07:00 committed by Anders Ingemann
parent 7ccce031e0
commit 96ebfe11fa

View file

@ -59,7 +59,7 @@ class EnableRootLogin(Task):
sshdconfig_path = os.path.join(info.root, 'etc/ssh/sshd_config')
if os.path.exists(sshdconfig_path):
from bootstrapvz.common.tools import sed_i
sed_i(sshdconfig_path, '^PermitRootLogin .*', 'PermitRootLogin yes')
sed_i(sshdconfig_path, '^#?PermitRootLogin .*', 'PermitRootLogin yes')
else:
import logging
logging.getLogger(__name__).warn('The OpenSSH server has not been installed, '
@ -75,7 +75,7 @@ class DisableRootLogin(Task):
sshdconfig_path = os.path.join(info.root, 'etc/ssh/sshd_config')
if os.path.exists(sshdconfig_path):
from bootstrapvz.common.tools import sed_i
sed_i(sshdconfig_path, '^PermitRootLogin .*', 'PermitRootLogin no')
sed_i(sshdconfig_path, '^#?PermitRootLogin .*', 'PermitRootLogin no')
else:
import logging
logging.getLogger(__name__).warn('The OpenSSH server has not been installed, '