cat /dev/urandom

mdff nospam at mgedv.net
Thu Jul 28 09:25:09 GMT 2005


> 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...



More information about the freebsd-questions mailing list