Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Commands & Shells

Simple Shell Random Password Generator

Submitted by on October 2, 2012 – 10:54 am One Comment

A very simple script to generate a random secure password of desired length. This can come in handy when setting up multiple user account and/or lacking imagination.

#!/bin/bash
# Random password generator
if [ $# -gt 0 ];then m=$1;else m=8;fi
d=$(expr $RANDOM % 5);l=$(expr ${m} + ${d})
cat /dev/urandom | tr -dc "a-zA-Z0-9@#*=" | dd  bs=${l} count=1 2>/dev/null;echo

 

Print Friendly, PDF & Email

One Comment »

Leave a Reply

%d bloggers like this: