 |
 |
 |
 |
| |
 |
| head -c 10 | /dev/random | uuencode -m - | tail -n 2 | head -n 1
that example provides random passwords too...
and to make it simple i use the following example:
#!/usr/bin/perl
if($ARGV[0] !~ /^\d+/) { $count=9; }
else { $count=$ARGV[0]; }
system("head -c $count /dev/random | uuencode -m - | tail -n 2 | head -n 1 ");
the only parameter is the lenght of the password we want to get... |
|
 |
| | Nice alternate examples vigour. I was actually emphasizing bash, as in a bash tutorial. Since there is no section for shell scripts, I placed it under "Linux". Nice examples of how to pipe commands together tho. |
|
 |
| Great job.Excellent script.
Sanjiv |
|
 |
| Really impressive !
Great ! |
|
 |
| |
 |
| AWESOME SCRIPT I WILL SO MAKE SURE TO... SCRIPT IT! YAAAAAAY SCRIPT! WOOOOH, YEAH! AWESOME! WOOOOOOO HOOOOOOOOOOO SCRIPT!
Its so awesome, I just had party in the comment box, and by the time you read this, it will be over. BLOCK THIS IP ADDRESS. ;\ |
|
 |
| |
 |
| I think the alternate is suppposed to be:
head -c 10 < /dev/random | uuencode -m - | tail -n 2 |d -n 1 |
|
 |
| |
 |
| I modified the code a bit. Like this more. I use it for creating secure WPA2 passphrases.
But hey, thanks for getting me started!
#!/bin/bash
MAXSIZE=62
array1=(
q w e r t y u i o p a s d f g h j k l z x c v b n m Q W E R T Y U I O P A S D
F G H J K L Z X C V B N M 1 2 3 4 5 6 7 8 9 0 \! \@ \# \$ \% \^ \& \* \( \)
\! \@ \# \$ \% \^ \& \* \( \) \! \@ \# \$ \% \^ \& \* \( \) \! \@ \# \$ \%
)
MODNUM=${#array1[*]}
pwd_len=0
while [ $pwd_len -lt $MAXSIZE ]
do
index=$(($RANDOM%$MODNUM))
echo -n "${array1[$index]}"
((pwd_len++))
done
echo
exit 0
|
|
 |
| Cool scriped we needed something simple here to generate passwords for users that was easy to pull out problem charicters (such as l and 0 and o) Which have a tendancy to cause problems with users
Worked like a charm
Oh and I added a parameter pass to the script as well as some of the different servers have different password length requirements
So bassically
MAXSIZE=$1 was the line I changed
Very handy thanks |
|
 |
| simpler version
#!/bin/bash
# Sets the maximum size of the password the script will generate
MAXSIZE=8
# Holds valid password characters. I choose alpha-numeric + the shift-number keyboard keys
# I put escape chars on all the non alpha-numeric characters just for precaution
array1=(
w e r t y u p a s d f h j k z x c v b m Q W E R T Y U P A D
F H J K L Z X C V B N M 2 3 4 7 8 ! @ $ % \# \& \* \= \- \+ \?
)
# Used in conjunction with modulus to keep random numbers in range of the array size
MODNUM=${#array1[*]}
# Keeps track of the number characters in the password we have generated
pwd_len=0
while [ $pwd_len -lt $MAXSIZE ]
do
index=$(($RANDOM%$MODNUM))
password="${password}${array1[$index]}"
((pwd_len++))
done
echo $password
|
|
 |
| Sehr gut gemacht ein Lob an dich auch aus Deutschland (Germany)
MfG C.Schumacher |
|
 |
| Awesome - now to strip out meta characters so can use this for temp files in Solaris 10:
head -2 /dev/random | uuencode -m - | tail -3 | head -1 | sed 's/[^A-z0-9]/Y/g'
Gregg |
|
 |
| On my linux box, I use this to make random passwords:
uuidgen | cut -c-8 |
|
 |
| That's a bit OTT.
function randompass {
pass=</dev/urandom tr -dc A-Za-z0-9| (head -c $1 > /dev/null 2>&1 || head -c 8)
echo $pass
}
|
|
 |
| Hello averyone,
Can someone please help me with this...
I would need to set up a passwd wiht the following steps:
- At least 2 uppercase letters
- At least 2 numbers letters
- The passwd should not start or finish wiht numbers.
Examples: LL67jsds, HH89cskj,kjUU89jj, Jkj8Jo9J, etc
|
|
 |
| Hey all, I use this little beauty. Its based on the /dev/random entropy pool, so is much more random than most others, and filters out untypable ascii characters. Its not exactly shell scripting, but since the release of OpenJDK...
/*
The purpose of this app is to generate a cryptographically
strong WPA password based on the Linux Entropy Pool at /dev/random.
This will not run on windows, nor would I wish it to. The Linux Entropy Pool is more random
then CryptGenRandom anyway =P
This code is released into the Public Domain,
http://creativecommons.org/licenses/publicdomain/
*/
import java.io.*;
public class SecPass {
private static final int pwlen = 63; //The desired length of the password. 63 is the default maximum.
private static final int bufbase = 1; //trying to conserve the entropy pool.
private static String buf = "";
public static void main(String[] args){
BufferedReader random = null;
try {
random = new BufferedReader(new FileReader("/dev/random")); //trying to eke a little more performance out of it
char[] tmp = new char[bufbase];
do {
random.read(tmp);
if (tmp[bufbase - 1] <= 126 && tmp[bufbase - 1] >= 33) {
buf = buf.concat(String.valueOf(tmp[bufbase - 1]));
}
} while (buf.length() < pwlen);
System.out.println(buf);
} catch (IOException ex) {
System.out.println("IO Error");
} finally {
try {
random.close();
System.exit(0);
} catch (IOException ex) {
System.out.println("Stream close error");
System.exit(-1);
}
}
}}
If your entropy pool is too small, it may take a sec to run, but enjoy!
-Matthias A
|
|
 |
| | uuidgen would only include hexadecimal characters(lower case for a-f) thus making it a "little" easier to crack if the person cracking was able to know this before trying to crack a hash. |
|
 |
| Quote: Hello averyone,
Can someone please help me with this...
I would need to set up a passwd wiht the following steps:
- At least 2 uppercase letters
- At least 2 numbers letters
- The passwd should not start or finish wiht numbers.
Examples: LL67jsds, HH89cskj,kjUU89jj, Jkj8Jo9J, etc
tr -dc '[:print:]' < /dev/urandom | fold -w 8 |grep .*[0-9].*[0-9].* -|grep ^[^0-9] |grep .*[A-Z].*[A-Z].* -|head |
|
 |
| ooppss
missed the the last bit:
Quote: or finish wiht numbers
tr -dc '[:print:]' < /dev/urandom | fold -w 8 |grep .*[0-9].*[0-9].* -|grep ^[^0-9] |grep [^0-9]$ |grep .*[A-Z].*[A-Z].* -|head
|
|
 |
| Hi. I made this script but I need random generator in awk and he must be the same like this for those arguments 2, 1 and 0:
#!/bin/bash
while [ 1 ]
do
echo "What is the number of arguments"
echo "Arguments:"
read arguments
case $arguments in
"2")
echo "What is the number of passwords:"
echo -n "Number: "
read number
echo "How long must be the password:"
#this mean how many must be the letters etc. in password
echo -n "long: "
read long
echo "//Generated password:"
pass=< /dev/urandom tr -cd '[:graph:]' | fold -w $long | head -n $number
echo $pass; break ;;
"1")
echo "What is the number of passwords:"
echo -n "Number: "
read number
echo "//Generated password:"
pass=< /dev/urandom tr -cd '[:graph:]' | fold -w 8 | head -n $number
echo $pass ; break ;;
"0")
echo "//Generated password:"
pass=< /dev/urandom tr -cd '[:graph:]' | fold -w 8 | head -n 1
echo $pass ; break ;;
*)continue ;;
esac
done
|
|
 |
| Quote Anon: can u tell me in details about what is cookie? A cookie is how a site recognizes your browser from other browsers; it's how when you check the remember me checkbox, you don't have to login again. Articulos Gratis |
|
 |
| hi ,
please could anyone help me in generating random commands for telnet
thanks |
|
 |
| hi ,
please could anyone help me in generating random commands for telnet
thanks |
|
 |
| hi ,
please could anyone help me in generating random commands for telnet
thanks |
|
 |
| |
 |
 |
 |
 |
Anonymously add a comment: (or register