root_password: Enable SSH root login

Jessie comes with root login disabled for passwords, however,
if the user is using this plugin, chances are high that they
need to login via SSH as root.
This commit is contained in:
Jonh Wendell 2015-04-28 17:03:54 -03:00
parent b3cda5e859
commit d9e9014a8f
2 changed files with 12 additions and 0 deletions

View file

@ -51,6 +51,17 @@ class DisableSSHPasswordAuthentication(Task):
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):
description = 'Disabling sshd remote host name lookup'
phase = phases.system_modification

View file

@ -10,4 +10,5 @@ def resolve_tasks(taskset, manifest):
from bootstrapvz.common.tasks import ssh
from tasks import SetRootPassword
taskset.discard(ssh.DisableSSHPasswordAuthentication)
taskset.add(ssh.PermitSSHRootLogin)
taskset.add(SetRootPassword)