How-to Generate Random Characters as Password Generator

If you just want a unique name, just use the current date and time.

%ICUDateTime%yyyyMMdd-HHmmss%

Or a random number:

%Calculate%RAND(1000000000000)%

If you want a password, you are generally better off to use a real password generating tool, however for your password generating purposes it probably does not matter how random it is since no one will be able to back-track to how you generated the password to attack the password that way. So a random number is probably fine here too. If you want letters as well, you can use something like this:

Execute Shell Script:
cat /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z0-9-_$?' | fold -w 16 | sed -e 1,10d -e 11q

Change the allowed characters a-zA-Z0-9-_$? and the password length 16 as desired.

Note this is a potentially weak password due to its reliance on urandom.

2 Likes