Re: random generated password

2011-09-02 Thread Michael

On 30/08/2011 19:30, Mike Tancsa wrote:


Preferably in a non-interactive and scriptable way. Is it possible with
the base system tools?


0(ich10)# pw usermod testuser1 -w random
Password for 'testuser1' is: km.y0LScI3p1
0(ich10)# pw usermod testuser1 -w random
Password for 'testuser1' is: P5RrhmUl4Np2
0(ich10)#



Perfect, exactly what I was looking for, thank you.

Michael
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


random generated password

2011-08-30 Thread Michael

Hello,

When adding a new user it is possible to assign a random generated 
password. But is it possible to assign a random password for already 
existing users?


Preferably in a non-interactive and scriptable way. Is it possible with 
the base system tools?


Michael

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: random generated password

2011-08-30 Thread Mike Tancsa
On 8/30/2011 2:16 PM, Michael wrote:
 Hello,
 
 When adding a new user it is possible to assign a random generated
 password. But is it possible to assign a random password for already
 existing users?

0(ich10)# pw useradd testuser1 -w random
Password for 'testuser1' is: oFPw9BPe
0(ich10)#


 
 Preferably in a non-interactive and scriptable way. Is it possible with
 the base system tools?

0(ich10)# pw usermod testuser1 -w random
Password for 'testuser1' is: km.y0LScI3p1
0(ich10)# pw usermod testuser1 -w random
Password for 'testuser1' is: P5RrhmUl4Np2
0(ich10)#

---Mike

-- 
---
Mike Tancsa, tel +1 519 651 3400
Sentex Communications, m...@sentex.net
Providing Internet services since 1994 www.sentex.net
Cambridge, Ontario Canada   http://www.tancsa.com/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: random generated password

2011-08-30 Thread Michael Sierchio
Presumably you're doing this to prevent direct login?

chpass allows root to set the encrypted password directly

chpass -p '$1$123456789$your-random-chars-here'


On Tue, Aug 30, 2011 at 11:16 AM, Michael mlmichae...@gmail.com wrote:
 Hello,

 When adding a new user it is possible to assign a random generated password.
 But is it possible to assign a random password for already existing users?

 Preferably in a non-interactive and scriptable way. Is it possible with the
 base system tools?

 Michael

 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: random generated password

2011-08-30 Thread Michael Sierchio
dd if=/dev/random count=1 | tr -c [:alnum:]
'0-9A-Za-z0-9A-Za-z0-9A-Za-a-z0-9A-Za-z'

will give you the right kind of characters to use, for example.

On Tue, Aug 30, 2011 at 11:32 AM, Michael Sierchio ku...@tenebras.com wrote:
 Presumably you're doing this to prevent direct login?

 chpass allows root to set the encrypted password directly

 chpass -p '$1$123456789$your-random-chars-here'


 On Tue, Aug 30, 2011 at 11:16 AM, Michael mlmichae...@gmail.com wrote:
 Hello,

 When adding a new user it is possible to assign a random generated password.
 But is it possible to assign a random password for already existing users?

 Preferably in a non-interactive and scriptable way. Is it possible with the
 base system tools?

 Michael

 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: random generated password

2011-08-30 Thread Michael Sierchio
Sorry, typo in cut-and-paste.

# dd if=/dev/random count=1 | tr -c [:alnum:]
'0-9A-Za-z0-9A-Za-z0-9A-Za-z' ; echo
zNvPGEVzCZ0QQRMUjtzcJJXRlKNPfVFCTEol0pdPmGEyzFiEUx0PUjPYMdUUYklbKPICmhS9IJEnxg4aaLVojizk6bjznuvzfLfAR4dfzX4nKfNqCAmVR13LZ08aUZzGyxW2jWNV9oBDBhcPQRmC2nzoEtCIE2PQdS5V2FIixBKjrB05nDnwMAfjzpVKQ7ft4GUsXNyAve9OIl3PUUTecezldocgvWrSFfbI8ztXw9zP2Ka9Gu39jFULWbLYwqNfzDMVOy76nPEWA9DfeT5yUrSO9fSyREAes7XxSbYvcyuzahBdqBaySc4EIgRQDBFqRxJ6hzbY7dg98HtcQzoWSrCgf2SA6VJwLivtld3eCddIz5HZIjcHUqISzFXMLnOPszV627zGhOm5Ei7diTQbf8GZQ3ZD8r7yY2ao9Mbm9w16nCt5issPD2toxoKSdqaNWYHbTCqEhXineHmQPwX9z1qDFZkM7B20FecLS5ECKe8yH7iSlIiFDCbAbFNVJ1PP
#

I'll leave it to you to pick out 9 chars for the seed and 31 chars for
the rest, as in

$1$zNvPGEVzC$Z0QQRMUjtzcJJXRlKNPfVFCTEol0pdP


On Tue, Aug 30, 2011 at 11:34 AM, Michael Sierchio ku...@tenebras.com wrote:
 dd if=/dev/random count=1 | tr -c [:alnum:]
 '0-9A-Za-z0-9A-Za-z0-9A-Za-a-z0-9A-Za-z'

 will give you the right kind of characters to use, for example.

 On Tue, Aug 30, 2011 at 11:32 AM, Michael Sierchio ku...@tenebras.com wrote:
 Presumably you're doing this to prevent direct login?

 chpass allows root to set the encrypted password directly

 chpass -p '$1$123456789$your-random-chars-here'


 On Tue, Aug 30, 2011 at 11:16 AM, Michael mlmichae...@gmail.com wrote:
 Hello,

 When adding a new user it is possible to assign a random generated password.
 But is it possible to assign a random password for already existing users?

 Preferably in a non-interactive and scriptable way. Is it possible with the
 base system tools?

 Michael

 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: random generated password

2011-08-30 Thread Randal L. Schwartz
 Michael == Michael Sierchio ku...@tenebras.com writes:

Michael dd if=/dev/random count=1 | tr -c [:alnum:]
Michael '0-9A-Za-z0-9A-Za-z0-9A-Za-a-z0-9A-Za-z'

Michael will give you the right kind of characters to use, for example.

I prefer openssl rand -base64 6 to get an 8-char password from a
fairly large set of sensible characters.  Each multiple of 3 results in 4
characters in the output.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
mer...@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: random generated password

2011-08-30 Thread Roland Smith
On Tue, Aug 30, 2011 at 07:16:00PM +0100, Michael wrote:
 Hello,
 
 When adding a new user it is possible to assign a random generated 
 password. But is it possible to assign a random password for already 
 existing users?
 
 Preferably in a non-interactive and scriptable way. Is it possible with 
 the base system tools?

Generating a random password can be done with the openssl in the base system;

openssl rand -base64 9

You'd want to pipe the output of this command through tee(1) and save it in a
file. Next you pipe it to a file discriptor leading to a 'pw usermod -h
0'. Something like this:

   openssl rand -base64 9 | tee -a newpasswords | pw usermod UID -h 0

where UID is the user-id or name of the user in question.


Roland
-- 
R.F.Smith   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)


pgp91FVL1FP8P.pgp
Description: PGP signature


Re: random generated password

2011-08-30 Thread Michael Sierchio
That occurred to me, but it's a smaller alphabet.  Probably doesn't
matter if the purpose is to make login unusable.

On Tue, Aug 30, 2011 at 11:40 AM, Randal L. Schwartz
mer...@stonehenge.com wrote:
 Michael == Michael Sierchio ku...@tenebras.com writes:

 Michael dd if=/dev/random count=1 | tr -c [:alnum:]
 Michael '0-9A-Za-z0-9A-Za-z0-9A-Za-a-z0-9A-Za-z'

 Michael will give you the right kind of characters to use, for example.

 I prefer openssl rand -base64 6 to get an 8-char password from a
 fairly large set of sensible characters.  Each multiple of 3 results in 4
 characters in the output.

 --
 Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
 mer...@stonehenge.com URL:http://www.stonehenge.com/merlyn/
 Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
 See http://methodsandmessages.posterous.com/ for Smalltalk discussion

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: random generated password

2011-08-30 Thread Pierre-Luc Drouin
If the purpose is to make login unusable, starring the password is the
only 100% safe way...

On Tue, Aug 30, 2011 at 2:42 PM, Michael Sierchio ku...@tenebras.com wrote:
 That occurred to me, but it's a smaller alphabet.  Probably doesn't
 matter if the purpose is to make login unusable.

 On Tue, Aug 30, 2011 at 11:40 AM, Randal L. Schwartz
 mer...@stonehenge.com wrote:
 Michael == Michael Sierchio ku...@tenebras.com writes:

 Michael dd if=/dev/random count=1 | tr -c [:alnum:]
 Michael '0-9A-Za-z0-9A-Za-z0-9A-Za-a-z0-9A-Za-z'

 Michael will give you the right kind of characters to use, for example.

 I prefer openssl rand -base64 6 to get an 8-char password from a
 fairly large set of sensible characters.  Each multiple of 3 results in 4
 characters in the output.

 --
 Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
 mer...@stonehenge.com URL:http://www.stonehenge.com/merlyn/
 Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
 See http://methodsandmessages.posterous.com/ for Smalltalk discussion

 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org