Yes if you enter the command that I first posted just as is in BASH in RHEL. You get this:
Code:
[root@radio5 ~]# < /dev/urandom tr -dc A-Za-z0-9_ | head -c8
lQIvHjtj[root@radio5 ~]#
If you take this example one step further and edit your ~/.bashrc file and add the code that Nixcraft posted you can get a cleaner output.
Code:
[root@radio5 bin]# vi ~/.bashrc
Add this to the top of the file:
PHP Code:
genpasswd() {
local l=$1
[ "$l" == "" ] && l=16
tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs
}
Next you type the following to generate a random password string:
Code:
[root@radio5 ~]# genpasswd 10
nCfKSfRxgU
[root@radio5 ~]#
You can alter the number 10 to whatever to get different values.
HTH,
Jaysunn