From 96ce50e57a20001dfbaa42dc1f29aec202ed6974 Mon Sep 17 00:00:00 2001 From: thomashaw Date: Mon, 6 Jul 2020 18:17:45 +0100 Subject: [PATCH] Update Kali user password with root_password with cleanup module --- modules/build/unix/cleanup/manifests/init.pp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/build/unix/cleanup/manifests/init.pp b/modules/build/unix/cleanup/manifests/init.pp index 88db45efd..286c0b422 100644 --- a/modules/build/unix/cleanup/manifests/init.pp +++ b/modules/build/unix/cleanup/manifests/init.pp @@ -14,6 +14,15 @@ class cleanup::init { managehome => true, } + # if kali_msf we have a default kali sudoer account by default, so change the kali user password too. + if $operatingsystemrelease == 'kali-rolling' and $root_password { + ::accounts::user { 'kali': + shell => '/bin/bash', + password => pw_hash($root_password, 'SHA-512', 'mysalt'), + managehome => true, + } + } + # Disable ssh if $disable_ssh { service { 'ssh':