#!/bin/bash [ -f user.log ] && rm -f user.log for i in `seq -w 10` do pass=$(echo $RANDOM`openssl rand -base64 8` | cut -c 1-10) useradd guest$i && echo "$pass" | passwd --stdin guest$i echo -e "user:guest$i \t pass:$pass" >> user.log done
原文地址:http://liusibo.blog.51cto.com/1382721/1557916