mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 18:00:35 +00:00
add root password setting
This commit is contained in:
parent
6c81ee2f8c
commit
5e6ac546cd
3 changed files with 11 additions and 2 deletions
|
@ -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(),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "EC2 manifest",
|
||||
"title": "OpenNebula manifest",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"volume": {
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Add table
Reference in a new issue