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
-
Here are some useful links about Indian laws, courts, legal system and various departments of Government of India. Man...
-
Network-Attached Storage 1. Introduction 2. What is a NAS Device? 3. What is a Filer? 4. Network-Attached Storage Versus Sto...
-
The Basics. Network Storage - The Basics Are you new to network storage? If so then this series of articles is for you! Over the next few...
-
Save a lot of typing with these handy bash features you won't find in an old-fashioned UNIX shell. bash, or the Bourne again shell, ...
-
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 DO...
-
* Determine the IPv4 addresses that you want to use for the additional interfaces. * Ensure that the physical interface to be configured has...
-
UNIX Questions and Answers Most answers refer to Solaris 2.x systems Hardware Issues How can I configure new devices without rebooting? What...
-
Tried Gusty Gibbon Ubuntu 6.10 on Compaq f733AU works fine without any major problems. some tweaking required in udev/rules/70-persistent-ne...
-
write 6 random bits of base64-encoded data. This will produce an eight character string making a good unix (crypt based) password: $ openssl...
-
Bryce Harrington and Kees Cook have come together to write this informative article titled ' Managing Disk Space with LVM ' which ...
0 comments:
Post a Comment