Random Password Generator Bash Script

marius

Administrator
Staff member
Introduction:
This script generates a random password of a specified length, including letters, numbers, and symbols for enhanced security.

Code Snippet:
Bash:
#!/bin/bash
# Random Password Generator
LENGTH=${1:-12}

tr -dc 'A-Za-z0-9_@#%&*' < /dev/urandom | head -c "$LENGTH"
echo

Instructions:
To generate a random password, run these commands:
Code:
chmod +x password_generator.sh
./password_generator.sh 16

Example Output:
Code:
jD9@kL0mP1%q3ZxB
 
Back
Top