Tuesday, December 25, 2012

Create a few users on the just installed Linux

# Create the group first with group ID 1000
groupadd -g 1000 dvdgrp1

# Create the first user with user ID 1000
useradd -u 1000 -g dvdgrp1 user1

# Add other users

for i in user2 user3 user4 user5 user6 user7 user8 user9 user10
do
    useradd -g dvdgrp1 $i
done


# Set initial password to the same as user name

for i in user1 user2 user3 user4 user5 user6 user7 user8 user9 user10
do
    echo $i | passwd --stdin $i
done

No comments: