Archive

Posts Tagged ‘shell script’

random password generator

April 23rd, 2009

I was searching in google how to generate random password and got two good easy to use methods.

First one is the most simplest one

 uuidgen -r | cut -c-8 or uuidgen -t | cut -c-8  

The -r option is for random based uuid generation with help of /dev/random and -t uses system clock plus ethernet address.

Second method is to call a function

function randompass {
        pass= /dev/null 2>&1 || head -c 7)
        echo $pass
} 

now you can call this function in the shell script by just typing the name of the function “randompass”

VN:F [1.9.6_1107]
Rating: 6.2/10 (5 votes cast)
VN:F [1.9.6_1107]
Rating: 0 (from 0 votes)

admin general, linux ,