Skip to main content
Uh,uh! Adding new user

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

1-Make a longfile name with matric numbers;
e.g
01234
02345
03455

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
times).

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

3- run this script, say here adduser.sh

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


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

Comments

Popular posts from this blog

Danga Bay, Chevrolet Optra and bio...(eh?) I thought it was Debian(haha). My colleague point me to the AirAsia flight turbin and he told me, "Macam debian punya logo" I saw a spiral on top the turbin blades. Pretty much like Debian Logo That's spark me to shoot for a pix. And I was warned by the airport staff. Uh,uh. Flash lamp will spark burst,eh? I was presented my "mock" research proposal. Suggested "Profiling Bioinformatics Application Behavior on Distributed Computing Architecture". Eh, will this gonna be bioinformatics specific or hardware optimization specific.or? Flashback: I spent almost a week at the office. When it's Subh azan,went back to my house for bath and pray. Reading all the journals and papers was not funny,really. Tough eye balls. No world cup. Ewh. And have some VCD lure. Uh,uh. you gonna be kidding. Anyway, I learned a lot and UTM SLAB Research Course is no joke. Really. My proposal has been corrected with comments so I have
Gue dengan S2 gue. Sronok banget!