mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
fix ^PermitRootLogin regex
fix issue https://github.com/andsens/bootstrap-vz/issues/218
This commit is contained in:
parent
e556366c19
commit
02c333c8c8
1 changed files with 2 additions and 2 deletions
|
@ -59,7 +59,7 @@ class EnableRootLogin(Task):
|
||||||
sshdconfig_path = os.path.join(info.root, 'etc/ssh/sshd_config')
|
sshdconfig_path = os.path.join(info.root, 'etc/ssh/sshd_config')
|
||||||
if os.path.exists(sshdconfig_path):
|
if os.path.exists(sshdconfig_path):
|
||||||
from bootstrapvz.common.tools import sed_i
|
from bootstrapvz.common.tools import sed_i
|
||||||
sed_i(sshdconfig_path, 'PermitRootLogin .*', 'PermitRootLogin yes')
|
sed_i(sshdconfig_path, '^PermitRootLogin .*', 'PermitRootLogin yes')
|
||||||
else:
|
else:
|
||||||
import logging
|
import logging
|
||||||
logging.getLogger(__name__).warn('The OpenSSH server has not been installed, '
|
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')
|
sshdconfig_path = os.path.join(info.root, 'etc/ssh/sshd_config')
|
||||||
if os.path.exists(sshdconfig_path):
|
if os.path.exists(sshdconfig_path):
|
||||||
from bootstrapvz.common.tools import sed_i
|
from bootstrapvz.common.tools import sed_i
|
||||||
sed_i(sshdconfig_path, 'PermitRootLogin .*', 'PermitRootLogin no')
|
sed_i(sshdconfig_path, '^PermitRootLogin .*', 'PermitRootLogin no')
|
||||||
else:
|
else:
|
||||||
import logging
|
import logging
|
||||||
logging.getLogger(__name__).warn('The OpenSSH server has not been installed, '
|
logging.getLogger(__name__).warn('The OpenSSH server has not been installed, '
|
||||||
|
|
Loading…
Add table
Reference in a new issue