lets see who remember last sem's CT's and end sem
Page 1 of 1 • Share •
lets see who remember last sem's CT's and end sem
write a script to add 50 users to ur machine without useradd command.
now delete these 50 users and thier all stuff without using userdel command
now delete these 50 users and thier all stuff without using userdel command

ankurgutpa- Posts: 44
Join date: 2008-08-10
Age: 22
Location: Tandon 72
Re: lets see who remember last sem's CT's and end sem
nice 2 see ankur u r taking active part in dis section............
and yes dis is a nice question and i hope 3rd cs-it guys w'll b posting d solution soon ............
and yes dis type of scripts we r going 2 ask u guys in tux wars and der will lot of unix knowlegde testing so b
preapred ..............
ankur ask ur friends also 2 take part in dis it seems u r only interested in unix................

and yes dis is a nice question and i hope 3rd cs-it guys w'll b posting d solution soon ............
and yes dis type of scripts we r going 2 ask u guys in tux wars and der will lot of unix knowlegde testing so b
preapred ..............
ankur ask ur friends also 2 take part in dis it seems u r only interested in unix................
Admin- Admin
- Posts: 39
Join date: 2008-08-03

Re: lets see who remember last sem's CT's and end sem
its simply................
i=1;
j=505;
while [ $i -le 50 ] ; do
mkdir /home/user$i;
echo "user$i:x:$j:" >> /etc/group;
echo "user$i::$j:$j:user$i:/home/user$i:/bin/bash" >>/etc/passwd;
cp /etc/skel/.* /home/user$i;
let i=$i+1;
let j=$j+1;
done
i=1;
j=505;
while [ $i -le 50 ] ; do
mkdir /home/user$i;
echo "user$i:x:$j:" >> /etc/group;
echo "user$i::$j:$j:user$i:/home/user$i:/bin/bash" >>/etc/passwd;
cp /etc/skel/.* /home/user$i;
let i=$i+1;
let j=$j+1;
done

souravgarg- Posts: 2
Join date: 2008-08-12
gargi
ur program is absolutely correct but u missed out something .
Think nettech
Think nettech

ankurgutpa- Posts: 44
Join date: 2008-08-10
Age: 22
Location: Tandon 72
Re: lets see who remember last sem's CT's and end sem
yar u written d script correctoly but u have missed shadow file and password .........
u can use passwd command to give passwd to users and shadow file willbe automatically loaded with d value.............
u can use passwd command to give passwd to users and shadow file willbe automatically loaded with d value.............
Admin- Admin
- Posts: 39
Join date: 2008-08-03

Re: lets see who remember last sem's CT's and end sem
and 1more thing nobodu has written for userdel try dat also...........

Admin- Admin
- Posts: 39
Join date: 2008-08-03

Admin
entry in shadow file ain't that important,user can login w/o password.
There's an important thing he missed out. Hint:u r in your home with hands tied
There's an important thing he missed out. Hint:u r in your home with hands tied

ankurgutpa- Posts: 44
Join date: 2008-08-10
Age: 22
Location: Tandon 72
Re: lets see who remember last sem's CT's and end sem
yaar it hit me... you have to give permissions to the user... correct me if wrong??
Beagle- Posts: 9
Join date: 2008-08-12
Re: lets see who remember last sem's CT's and end sem
u got it beagle
the lines are:
chown -R user$i /home/user$i
chgrp -R user$i /home/user$i
chmod 700 /home/user$i
the lines are:
chown -R user$i /home/user$i
chgrp -R user$i /home/user$i
chmod 700 /home/user$i

ankurgutpa- Posts: 44
Join date: 2008-08-10
Age: 22
Location: Tandon 72
yeah.....
yeah...u r right...
but entry in shadow file is important..when we use 'x' in second field of passwd file......
otherwise.. it works without entry in shadow file also.....
but entry in shadow file is important..when we use 'x' in second field of passwd file......
otherwise.. it works without entry in shadow file also.....

souravgarg- Posts: 2
Join date: 2008-08-12
Re: lets see who remember last sem's CT's and end sem
ankur do u know user can login even if he has no entry in /etc/passwd file so problem is not just for login u have to manage its security also so use passwd caommand and provide a proper password 2 user .....
Admin- Admin
- Posts: 39
Join date: 2008-08-03

Admin
how can user login w/o having entry in /etc/passwd ? 

ankurgutpa- Posts: 44
Join date: 2008-08-10
Age: 22
Location: Tandon 72
Re: lets see who remember last sem's CT's and end sem
dear ankur it seems u have not attended the workshop of unix
dis thing have been discuss in that workshop and u can ask to any one of freinds who have attented the workshop
and haan one more thing please take part in activities your seniors are oragnising that is for your benefits only
dis thing have been discuss in that workshop and u can ask to any one of freinds who have attented the workshop
and haan one more thing please take part in activities your seniors are oragnising that is for your benefits only
Admin- Admin
- Posts: 39
Join date: 2008-08-03

Permissions of this forum:
You cannot reply to topics in this forum





