Quickzi: Generate Random Passwords on the Linux Command Line
Monday, April 14th, 2008 at
3:22 pm
Here is a quick one line command to generate a random password from the Linux command line.
# < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c6
If you want a password length longer than 6, changing the -c6 to read -c8 will give you 8 random characters instead of 6.
Popularity: 9% [?]
Tagged with: Linux • passwords • quickzi • tips • tricks
Filed under: Linux
Like this post? Subscribe to my RSS feed and get loads more!













Needs something to add a newline to the end.
Newline at the end:
$ echo `< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c6`
Hi,
I need to generate 10 random numbers using /dev/random.
Is this possible ?
Can you give me syntax for same.
Also how can i execute this in PHP.
Thanks in advance
you can get password generator in Debian:
#pwgen
no_of_passwords=10
password_lenght=16
i=0
while [[ $i -le $no_of_passwords ]]; do
new_pass=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c$password_lenght)
[[ -n "$new_pass" ]] &done
Try;date | md5sum