linux

linux: add users in batch mode


#!/bin/bash

# Iterate over the amount of ports
START=1
END=50
USER_PREFIX=
for i in $(seq $START $END); do
USER=$USER_PREFIX$i
PASSWORD=$(tr -cd '[:alnum:]' /dev/null; then
chage -M 30 $USER
chage -d 0 $USER
usermod -a -G docker $USER
usermod --shell /bin/bash $USER
echo "$USER,$PASSWORD"
fi
done

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s