added genpw.py
This commit is contained in:
@@ -31,5 +31,5 @@ Create a playbook like this
|
|||||||
## How to generate pwhash
|
## How to generate pwhash
|
||||||
```mkpasswd -m sha-512```
|
```mkpasswd -m sha-512```
|
||||||
|
|
||||||
or use the following python script which generates random password and a hash at the same time
|
Or genpw.py which generates random password and a hash at the same time.
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
import string
|
||||||
|
import crypt
|
||||||
|
from random import *
|
||||||
|
characters = string.ascii_letters + "~@#$%^&*()-_+=23456789"
|
||||||
|
|
||||||
|
for i in range(0,4):
|
||||||
|
password = "".join(choice(characters) for x in range(randint(10, 15)));
|
||||||
|
salt = crypt.mksalt(method=crypt.METHOD_SHA512);
|
||||||
|
print (password);
|
||||||
|
print (crypt.crypt(password,salt=salt));
|
||||||
Reference in New Issue
Block a user