python-provy/provy — pull request #129 by jbzdak (2013-09-25 21:12:06+00:00)
Title: Jbzdak/add encrypted password to users

Basically I tried to enable sending hashed passwords to remote server (that can be either copied from /etc/shadow on local machine, or generated using utility methods).

Now password setting flow is that:

* You send passsword to a temporary file (both encrypted and not encrypted)
* then `cat` the file to 'chpasswd` (as I remember saving password to file is needed because of fabric issues with $ escaping and encrypted passwords having $). If this was not needed you could simplify program logic a bit.

I also removed `-p` parameter from useradd, here is why:

```
provision@debian:/tmp$ sudo useradd foo -p bar
provision@debian:/tmp$ sudo cat /etc/shadow
foo:bar:15973:0:99999:7:::
```

basically useradd just pastes result of -p to `/etc/shadow` and I gues that this is not a good thing (especially that there is only one string for no password and it is `!`). Another problem with echoing "user:pass" is that password is entered in command line and can be sniffed using `ps`(but saving password to wile is not that good either...).