Skip to content

Instantly share code, notes, and snippets.

Automating Linux User & Group Creation with create_users.sh

Author: NANGI THANUSHA Date: 05/10/2025 Public: Yes

Summary

This article explains create_users.sh, a small bash utility to bulk-create users and groups on Ubuntu from a formatted text file. It creates a personal primary group for each user, sets home directory permissions, generates secure random passwords, logs activity to /var/log/user_management.log, and stores generated passwords in /var/secure/user_passwords.csv (owner-only read).

Input format

Each non-empty line of the input file must be: