« Back to Files

/dev/random: providing random numbers

This article has last been updated at .

Purpose

The /dev/random file provides random data from the Linux kernel random number generator. Typically /dev/urandom is the preferred source for random data.

This file on Linux is a filesystem interface to an operating system device driver of type character.

File permissions

The file permissions of the /dev/random file are usually 666 (rw-rw-rw-), meaning user, group, and others can read and write.

Notes

Usually /dev/random is created during the boot cycle using the mknod command. The random numbers provided are generated from an entropy pool that is filled using noise such as from device drivers. The underlying random functions also track the number of bits in the entropy pool, and may give a warning if it is not sufficient.

More information and usage of /dev/random

The following articles have a reference to /dev/random and might be worth reading to learn more.

Feedback

Small picture of Michael Boelen

This article has been written by our Linux security expert Michael Boelen. With focus on creating high-quality articles and relevant examples, he wants to improve the field of Linux security. No more web full of copy-pasted blog posts.

Discovered outdated information or have a question? Share your thoughts. Thanks for your contribution!

Mastodon icon

Related articles

Like to learn more? Here is a list of articles within the same category or having similar tags.