|
Post by jamba on Feb 21, 2010 13:36:56 GMT -5
Generating password is simple:
password8.sh:
#!/bin/sh cat /dev/urandom| tr -dc '0-9a-zA-Z!@#$%^&*_+-'|head -c 8;echo
This script generates 8 characters long password. To change number of characters, replace 8 with other number. '0-9a-zA-Z!@#$%^&*_+-' defines character set used in password. If you need another charset, change this string to suit your needs.
|
|
|
Post by jamba on Feb 21, 2010 13:38:25 GMT -5
www.linuxhowtos.org/Security/password_generator.htmA Quick and Easy Password Generator This short tutorial shows you how to quickly generate a list of passwords using /dev/urandom, and uuencode.
Code Listing 1
% dd if=/dev/urandom count=1 2> /dev/null | uuencode -m - | sed -ne 2p | cut -c-8 v1/oVN+S
The options for the cut command indicate the length of the password generated (in this case, 8 characters). This could easily be expanded to generate a whole list of passwords using the for command.
Code Listing 2
% for ((n=0;n<10;n++)); do dd if=/dev/urandom count=1 2> /dev/null | uuencode -m -| sed -ne 2p | cut -c-8; done rSQpeNNr PesAIgAb GUEgoUwT U3p+kfqa WSgSwgq6 +9aGihvl dYfcaV3b guFtI7eZ +kzKuW0f jJpW/8yO
To create a longer or shorter list, just change the limit in for (in this case 10).
If you want to generate WEP keys for wireless networking, you can use a similar procedure, replacing uuencode with md5sum:
Code Listing 3
% dd if=/dev/urandom count=1 2> /dev/null | md5sum | cut -c-26 aaab69457c239ef1d52617d1fa
Adapted from www.gentoo.org/news/en/gwn/20030804-newsletter.xml
|
|