mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-10-08 01:40:31 +00:00
Merge pull request #216 from jwendell/PermitRootLogin
root_password: Enable SSH root login
This commit is contained in:
commit
661f85d350
2 changed files with 12 additions and 0 deletions
|
@ -51,6 +51,17 @@ class DisableSSHPasswordAuthentication(Task):
|
||||||
sed_i(sshd_config_path, '^#PasswordAuthentication yes', 'PasswordAuthentication no')
|
sed_i(sshd_config_path, '^#PasswordAuthentication yes', 'PasswordAuthentication no')
|
||||||
|
|
||||||
|
|
||||||
|
class PermitSSHRootLogin(Task):
|
||||||
|
description = 'Permitting SSH root login'
|
||||||
|
phase = phases.system_modification
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def run(cls, info):
|
||||||
|
from ..tools import sed_i
|
||||||
|
sshd_config_path = os.path.join(info.root, 'etc/ssh/sshd_config')
|
||||||
|
sed_i(sshd_config_path, '^PermitRootLogin .*', 'PermitRootLogin yes')
|
||||||
|
|
||||||
|
|
||||||
class DisableSSHDNSLookup(Task):
|
class DisableSSHDNSLookup(Task):
|
||||||
description = 'Disabling sshd remote host name lookup'
|
description = 'Disabling sshd remote host name lookup'
|
||||||
phase = phases.system_modification
|
phase = phases.system_modification
|
||||||
|
|
|
@ -10,4 +10,5 @@ def resolve_tasks(taskset, manifest):
|
||||||
from bootstrapvz.common.tasks import ssh
|
from bootstrapvz.common.tasks import ssh
|
||||||
from tasks import SetRootPassword
|
from tasks import SetRootPassword
|
||||||
taskset.discard(ssh.DisableSSHPasswordAuthentication)
|
taskset.discard(ssh.DisableSSHPasswordAuthentication)
|
||||||
|
taskset.add(ssh.PermitSSHRootLogin)
|
||||||
taskset.add(SetRootPassword)
|
taskset.add(SetRootPassword)
|
||||||
|
|
Loading…
Add table
Reference in a new issue