Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jul 2005 11:25:05 +0200
From:      "mdff" <nospam@mgedv.net>
To:        <freebsd-questions@freebsd.org>
Subject:   RE: cat /dev/urandom
Message-ID:  <20050728092506.096B3186800@mgedv.at>
In-Reply-To: <20050726183029.M97284@neptune.atopia.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> shell# cat /dev/urandom
> 
> can that executed as root cause any harm to the system?  What 
> if a random 
> sequence of `rm *` was generated... would it be executed?
> 

the question is: WHAT FOR should someone logged in as root
execute "cat /dev/urandom" without redirecting the output?

anyway, from my experience of "trying" this a few times (it does
not matter if on a local console or using a ssh-client) sometimes
there's code left in the commandline afterwards and if you hit
enter, it's executed... directly executed strings i've also seen.
for now, i didn't have the occurrence of any system-command being
generated, but that's random... the unlucky one would get it asap ;-)

if you like to get RANDOM content anywhere use dd instead of cat.
example to erase a whole disk i'd type:
dd if=/dev/urandom of=/dev/<devicefile> bs=1024k
be sure that the devicefile exists, or you'll fill up your /root fs.
br...




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050728092506.096B3186800>