From 02c333c8c82c33dfb60f6914a09dad73c2537cc5 Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Fri, 8 May 2015 09:11:14 +0200 Subject: [PATCH] fix ^PermitRootLogin regex fix issue https://github.com/andsens/bootstrap-vz/issues/218 --- bootstrapvz/common/tasks/ssh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrapvz/common/tasks/ssh.py b/bootstrapvz/common/tasks/ssh.py index c3f14c5..f83db8a 100644 --- a/bootstrapvz/common/tasks/ssh.py +++ b/bootstrapvz/common/tasks/ssh.py @@ -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, '