Mezgani blog

August 16, 2010

Create random password using /dev/urandom

Filed under: bash, linux — Tags: , — Ali MEZGANI @ 11:34 am

In many situation administrators are affronted to generate passwords, however it’s more secure to keep in eyes random password even that ordinarie one.
Well, for such use let’s keep it simple and let’s define some files:

/dev/random: is a special file that serves as a true random number generator or as a pseudorandom number generator.
/dev/urandom: (“unlocked” random source) which reuses the internal pool to produce more pseudo-random bits.

If your system does not have /dev/random and /dev/urandom created already, they can be created with the following commands:
$ mknod -m 644 /dev/random c 1 8
$ mknod -m 644 /dev/urandom c 1 9
$ chown root:root /dev/random /dev/urandom


$ tr -cd a-zA-Z0-9 < /dev/urandom | head -c 12 ; echo ""

About these ads

1 Comment »

  1. [...] to generate strong random passwordsBreaking into an Android password manager – TheoryCreate random password using /dev/urandom#header { background: [...]

    Pingback by Creating a Secure Password — August 24, 2012 @ 9:01 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: