How to generate a random password in linux using /dev/random

User Avatar
👤 admin
🔴 Admin
✍️ The most important thing in the world is to not be alone.
⏳ Last active: 15 Apr 2025 at 16:01
📅 Created: 17 Feb 2021 at 17:39
👀 Viewed: 22 times
✉️ Send Email

What is /dev/random?
In Unix-like operating systems, /dev/random, /dev/urandom and /dev/arandom are special files that serve as pseudorandom number generators. They allow access to environmental noise collected from device drivers and other sources.

Here is an example where we generate a password with 10 symbols


</dev/urandom tr -dc '12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c10; echo ""

You can edit the symbols and the length for the generated password. -c10 is the lenght.

https://youtu.be/WW7wsnEXKi8

If you want to comment: Login or Register