write 6 random bits of base64-encoded data. This will produce an eight character string making a good unix (crypt based) password:
$ openssl rand -base64 6
$RcqcGq4h
This is an example used to generate a 16 character password
$ openssl rand -base64 12
$IEoOfT/LKimAf/sd
When random data goes through the base encoding process the string output is always a multiple of 4 possibly padded on the end with one or more '=' characters. So if you want a password that is not a multiple of 4 you need to artifically chop it where you want it.
An example used to generate a 37 character password:
with cut:
$ openssl rand -base64 37 cut -c1-37
$X/UhqF1I9qO57Uz8hPufpvbOLYCeuuvqnerUM
or sed:
$ openssl rand -base64 37 sed -e 's/^\(.\{37\}\).*/\1/g' $sAPpFoGnbXnJrQc8Cl/QqrNwn0QK3hHrgANt1
or awk:
$ openssl rand -base64 37 awk 'BEGIN{FS=""} {for (i=1;i<=37;i++) printf("%s",$i);} {printf "\n"}'
$WhGWSCp8Y2uilxWfOfAyQXa4QqlE78uJeH3sn
Popular Posts
-
Well. We speak so much of security and make secure system, in concerns of that here I am explaining how to put ACL's on AIX sys...
-
Dear Friends, We have been working in UNIX platform since the last 3-4 years and we realized that industry is in need of qua...
-
Linux admin interview questions How do you take a single line of input from the user in a shell script? Write a script to convert all D...
-
All the commands are fired from (% - user) prompt not (# - root) so do not confuse with the #es there with root prompt. They are the command...
-
Enable them: Turn on these three using chkconfig on both the nodes: rexec, rsh and rlogin. # chkconfig rexec on # chkconfig rsh on # chkc...
-
Bryce Harrington and Kees Cook have come together to write this informative article titled ' Managing Disk Space with LVM ' which explains...
-
The PAM (Pluggable Authentication Module) module pam_tally keeps track of unsuccessful login attempts then disables user accounts when a pr...
-
-----Original Message----- From: www4mail@wm.ictp.trieste.it [mailto:www4mail@wm.ictp.trieste.it] Sent: Fri 9/9/2005 2:09 AM To: gra...
-
UNIX Questions and Answers Most answers refer to Solaris 2.x systems Hardware Issues How can I configure new devices without rebo...
-
Password Aging While it's clearly possible to use the /etc/passwd and /etc/shadow files in Solaris and other Unix systems without making ...
Post a Comment