Uh,uh! Adding new user

Any better solution, please share. This what I have/tried did so far;

1-Make a longfile name with matric numbers;

save in user.txt

2-As there are a lot of users with different matrix number, the idea is
to keep username unique and easy to recognize as possible;

use sed (unix Stream Editor);

sed -i 's@^\([0-9]\)@coursename\1@g' user.txt

this will put the course name as the prefiks of the matrics number
inserted in the longlist(so you save time to insert same thing for many

(replace coursename with the name that relates; spl or java,AI for example).

3- run this script, say here adduser.sh

#adding user
for i in `cat userlist.txt`;
do useradd $i -s /bin/bash -d /home/$i -m ;
echo $i;
passwd $i;

This is the fastest and the accurate that I can do, you all might have
better solution. Thanks!
(Adding new users on 2 different machine plus 2 new password enquiries
means we need better way of adding new users).
p/s: still figuring out the best way to assign password in the loop here


Popular posts from this blog

Review Huawei Nova 2i, fon dual-camera terbaik pada harga yang berbaloi

Panduan Bas Ekspres Kuala Lumpur (TBS) - Skudai