How can I use
/dev/(u)random on Ubuntu or any *nix sistems?
I tried this but it says permission denied.
Note : I also tried as root.
/dev/(u)random sudo /dev/(u)random sudo -s; /dev/(u)random
It's a file like device, so you can do things like cat it or copy from it. For instance:
Creates a file containing 4K of random bytes.
Will continue to write random bytes to that file until you hit Ctrl-C. Don't do this on a low performing system...
Will write 30 lines of random bytes
Get random bytes
If you need a certain number of random bytes, read that number of bytes from
You can use
So, to read 30 random bytes into a file
You can read from it as a normal user.
Leave alone /dev/random
Normally, you want to use
The problem is that
When you use