add root password setting

This commit is contained in:
Olivier Sallou 2013-07-10 16:34:12 +02:00
parent 6c81ee2f8c
commit 5e6ac546cd
3 changed files with 11 additions and 2 deletions

View file

@ -48,7 +48,9 @@ def tasks(tasklist, manifest):
boot.BlackListModules(), boot.BlackListModules(),
boot.DisableGetTTYs(), boot.DisableGetTTYs(),
security.EnableShadowConfig(), security.EnableShadowConfig(),
security.DisableSSHPasswordAuthentication(), security.SetRootPassword(),
# Disable for the time of debugging
#security.DisableSSHPasswordAuthentication(),
security.DisableSSHDNSLookup(), security.DisableSSHDNSLookup(),
network.RemoveDNSInfo(), network.RemoveDNSInfo(),
network.ConfigureNetworkIF(), network.ConfigureNetworkIF(),

View file

@ -1,6 +1,6 @@
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#",
"title": "EC2 manifest", "title": "OpenNebula manifest",
"type": "object", "type": "object",
"properties": { "properties": {
"volume": { "volume": {

View file

@ -11,6 +11,13 @@ class EnableShadowConfig(Task):
from common.tools import log_check_call from common.tools import log_check_call
log_check_call(['/usr/sbin/chroot', info.root, '/sbin/shadowconfig', 'on']) 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): class DisableSSHPasswordAuthentication(Task):
description = 'Disabling SSH password authentication' description = 'Disabling SSH password authentication'