lets see who remember last sem's CT's and end sem

Go down

lets see who remember last sem's CT's and end sem

Post  ankurgutpa on Tue Aug 12, 2008 11:54 am

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 cheers
avatar
ankurgutpa

Posts : 44
Join date : 2008-08-10
Age : 31
Location : Tandon 72

View user profile

Back to top Go down

Re: lets see who remember last sem's CT's and end sem

Post  Admin on Tue Aug 12, 2008 12:48 pm

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................
Smile

Admin
Admin

Posts : 39
Join date : 2008-08-03

View user profile http://computerclub09mnnit.forumotion.net

Back to top Go down

Re: lets see who remember last sem's CT's and end sem

Post  souravgarg on Thu Aug 14, 2008 10:40 am

its simply................
i=1;
j=505;
while [ $i -le 50 ] ; do
mkdir /home/user$i;
echo "user$i❌$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
avatar
souravgarg

Posts : 2
Join date : 2008-08-12

View user profile

Back to top Go down

gargi

Post  ankurgutpa on Thu Aug 14, 2008 12:50 pm

ur program is absolutely correct but u missed out something .
Think nettech cheers
avatar
ankurgutpa

Posts : 44
Join date : 2008-08-10
Age : 31
Location : Tandon 72

View user profile

Back to top Go down

Re: lets see who remember last sem's CT's and end sem

Post  Admin on Fri Aug 15, 2008 2:18 am

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

Admin
Admin

Posts : 39
Join date : 2008-08-03

View user profile http://computerclub09mnnit.forumotion.net

Back to top Go down

Re: lets see who remember last sem's CT's and end sem

Post  Admin on Fri Aug 15, 2008 2:19 am

and 1more thing nobodu has written for userdel try dat also...........
Very Happy

Admin
Admin

Posts : 39
Join date : 2008-08-03

View user profile http://computerclub09mnnit.forumotion.net

Back to top Go down

Admin

Post  ankurgutpa on Sat Aug 16, 2008 2:07 am

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
avatar
ankurgutpa

Posts : 44
Join date : 2008-08-10
Age : 31
Location : Tandon 72

View user profile

Back to top Go down

Re: lets see who remember last sem's CT's and end sem

Post  Beagle on Sat Aug 16, 2008 5:34 am

yaar it hit me... you have to give permissions to the user... correct me if wrong??

Beagle

Posts : 9
Join date : 2008-08-11

View user profile

Back to top Go down

Re: lets see who remember last sem's CT's and end sem

Post  ankurgutpa on Sat Aug 16, 2008 6:00 am

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 cheers
avatar
ankurgutpa

Posts : 44
Join date : 2008-08-10
Age : 31
Location : Tandon 72

View user profile

Back to top Go down

yeah.....

Post  souravgarg on Sat Aug 16, 2008 6:40 am

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.....
avatar
souravgarg

Posts : 2
Join date : 2008-08-12

View user profile

Back to top Go down

Re: lets see who remember last sem's CT's and end sem

Post  Admin on Sun Aug 17, 2008 11:31 am

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

View user profile http://computerclub09mnnit.forumotion.net

Back to top Go down

Admin

Post  ankurgutpa on Sun Aug 31, 2008 12:10 pm

how can user login w/o having entry in /etc/passwd ? Shocked
avatar
ankurgutpa

Posts : 44
Join date : 2008-08-10
Age : 31
Location : Tandon 72

View user profile

Back to top Go down

Re: lets see who remember last sem's CT's and end sem

Post  Admin on Mon Sep 01, 2008 6:52 am

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 Smile

Admin
Admin

Posts : 39
Join date : 2008-08-03

View user profile http://computerclub09mnnit.forumotion.net

Back to top Go down

Re: lets see who remember last sem's CT's and end sem

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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