updated readme

This commit is contained in:
xpk
2019-01-21 18:53:24 +08:00
parent 87957c15b5
commit 266df1dcb9
+2 -16
View File
@@ -2,11 +2,13 @@
Create user and optionally put user into sudoers. By default, user is added to ssh_access group. Create user and optionally put user into sudoers. By default, user is added to ssh_access group.
## Required variables: ## Required variables:
```
user: user:
name: john name: john
group: clientadmin group: clientadmin
pwhash: sha512 hash pwhash: sha512 hash
sudoers: yes/no sudoers: yes/no
```
## Usage: ## Usage:
Create a playbook like this Create a playbook like this
@@ -31,19 +33,3 @@ Create a playbook like this
or use the following python script which generates random password and a hash at the same time or use the following python script which generates random password and a hash at the same time
```
#!/usr/bin/env python3
import string
import crypt
import threading
from random import *
characters = string.ascii_letters + "~@#$%^&*()-_+=23456789"
def genOne():
password = "".join(choice(characters) for x in range(randint(10, 15)));
salt = crypt.mksalt(method=crypt.METHOD_SHA512);
print (password, "|", crypt.crypt(password,salt=salt));
for i in range(4):
threading.Thread(target=genOne, args=()).start()
```