#!/bin/bash # kiosk.create_users.sh # part of the kiosk-shell-scripts # # create users with password but without a home directory # use with pam_mkhomedir.so to create the home directories on-the-fly # reads ascii file in the form: # loginname password credit # to create users with the given amount of credit # passwords are encrypted with md5! # min_userid is set from kiosk.conf # # Usage: $0 <file> # this script needs root privileges . /etc/kiosk.conf [[ ! `whoami` == root ]] && echo "root privileges required!" [[ -z "$1" ]] && echo "Usage: $0 input-file" && exit while read LOGIN PASSWD CREDIT do echo "->>"$LOGIN useradd -K UID_MIN=$MIN_UID "$LOGIN" echo "$LOGIN:$PASSWD" |chpasswd --md5 echo $CREDIT > $KIOSKDIR/$LOGIN done< $1