1
 $ python -c 'import random; print(random.randint(0,1000000-1))'

Sept. 19, 2018, 10:42 p.m.johntellsall

Explanation

StackOverflow has a dozen different ways to generate numbers, all of which fall apart after 3-4 digits. This solution requires Python to be installed, but is simple and direct.

Limitations

Requires Python, it's not a pure-Bash solution