diff --git a/providers/one/__init__.py b/providers/one/__init__.py index 426607f..067a964 100644 --- a/providers/one/__init__.py +++ b/providers/one/__init__.py @@ -48,7 +48,9 @@ def tasks(tasklist, manifest): boot.BlackListModules(), boot.DisableGetTTYs(), security.EnableShadowConfig(), - security.DisableSSHPasswordAuthentication(), + security.SetRootPassword(), + # Disable for the time of debugging + #security.DisableSSHPasswordAuthentication(), security.DisableSSHDNSLookup(), network.RemoveDNSInfo(), network.ConfigureNetworkIF(), diff --git a/providers/one/manifest-schema.json b/providers/one/manifest-schema.json index 0a6a038..8c9e8f5 100644 --- a/providers/one/manifest-schema.json +++ b/providers/one/manifest-schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "title": "EC2 manifest", + "title": "OpenNebula manifest", "type": "object", "properties": { "volume": { diff --git a/providers/one/tasks/security.py b/providers/one/tasks/security.py index 50d8db6..0178af2 100644 --- a/providers/one/tasks/security.py +++ b/providers/one/tasks/security.py @@ -11,6 +11,13 @@ class EnableShadowConfig(Task): from common.tools import log_check_call log_check_call(['/usr/sbin/chroot', info.root, '/sbin/shadowconfig', 'on']) +class SetRootPassword(Task): + description = 'Set password for root' + phase = phases.system_modification + + def run(self, info): + from common.tools import log_check_call + log_check_call(['/usr/sbin/chpasswd'], 'root:'+info.manifest.credentials['root']) class DisableSSHPasswordAuthentication(Task): description = 'Disabling SSH password authentication'