Files
pspy/docker/root/scripts/password_reset.py
2018-02-18 14:03:59 +01:00

13 lines
338 B
Python

#!/usr/bin/python
import string
import random
from subprocess import call
new_password = ''.join(random.SystemRandom()
.choice(string.ascii_uppercase + string.digits)
for _ in range(16))
call("/bin/echo -e \"{}\\n{}\" | passwd myuser"
.format(new_password, new_password), shell=True)