Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
81
rated 0 times [  81] [ 0]  / answers: 1 / hits: 74338  / 2 Years ago, tue, april 12, 2022, 11:36:08

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

More From » kernel

 Answers
5

It's a file like device, so you can do things like cat it or copy from it. For instance:



dd if=/dev/urandom of=~/urandom_test count=4 bs=1024


Creates a file containing 4K of random bytes.



cat /dev/urandom > ~/urandom_test2 


Will continue to write random bytes to that file until you hit Ctrl-C. Don't do this on a low performing system...



head -30 /dev/urandom > ~/urandom_test3


Will write 30 lines of random bytes


[#35363] Wednesday, April 13, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
uffno

Total Points: 283
Total Questions: 93
Total Answers: 111

Location: Saint Vincent and the Grenadines
Member since Thu, Oct 15, 2020
4 Years ago
uffno questions
Thu, Sep 2, 21, 18:08, 3 Years ago
Sun, Apr 2, 23, 15:15, 1 Year ago
Sat, Jan 8, 22, 16:37, 2 Years ago
;