Thursday, November 1, 2012

Creating multiple users at once

 So you need to create a bunch of standardized users for whatever reason and you need them 10 minutes ago?

for username in user_one user_two user_three; \
do useradd -m -G user_group ${username}; \
echo -e "user_password\nuser_password"|passwd --stdin ${username]; \
mkdir /home/${username}/some_folder; \
chown -R ${username}:${username} /home/${username}; \
done

No comments:

Post a Comment