Re: [Tutor] something weird

2013-12-12 Thread Alan Gauld
On 12/12/13 17:13, Paolo Supino wrote: print "password hash: " + crypt.crypt("password") When I try to do su - [user] (after copying the hash into /etc/shadow) the password accepted is 'password' You are passing the literal string password to the crypt() call. I suspect that has something t

[Tutor] something weird

2013-12-12 Thread Paolo Supino
Hi I've written the following small script to create SHA512 salted hash to insert into /etc/shadow #!/bin/env python import sys, crypt, getpass interactive="no" wantedNumberArgs=2 minumumLength=8 argc=len(sys.argv) if argc == wantedNumberArgs: password=str(sys.argv[1]) elif argc > wantedNu