disable expiring password to troubleshoot

This commit is contained in:
Jordan Rodgers 2018-02-12 12:49:06 -05:00
parent 451f992d8f
commit d7541fe356

View file

@ -145,16 +145,13 @@ def setup_template(template_id, name, user, password, cores, memory):
print("[{}] Running user creation commands.".format(name))
stdin, stdout, stderr = client.exec_command("useradd {}".format(user))
exit_status = stdout.channel.recv_exit_status()
print(exit_status)
root_password = gen_password(32)
stdin, stdout, stderr = client.exec_command(
"echo '{}' | passwd root --stdin".format(root_password))
exit_status = stdout.channel.recv_exit_status()
print(exit_status)
stdin, stdout, stderr = client.exec_command(
"echo '{}' | passwd '{}' -e --stdin".format(password, user))
"echo '{}' | passwd '{}' --stdin".format(password, user))
exit_status = stdout.channel.recv_exit_status()
print(exit_status)
stdin, stdout, stderr = client.exec_command(
"echo '{} ALL=(ALL:ALL) ALL' | sudo EDITOR='tee -a' visudo".format(
user))