bulk deleting users solaris 7 NIS
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > bulk deleting users solaris 7 NIS




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    bulk deleting users solaris 7 NIS  
discussie@vandehoedenderand.nl


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-02-05 10:57 PM

I have inherited the administration over a SUN Sparc Solaris machine
on a school. This machine has 2800 userids defined and only 1500 of
them are in use. How can I easily delete, (perlscript maybe?) my
surplus of 1300 userid from the NIS databases. I have managed to
compile a list of userids that can be removed so the input can be
read from file. Can you please point me in the right direction as
to how I can do that. Or better yet have a ready solution for me.

Thanks in advance.

Regards,
Peter Berkhout.






[ Post a follow-up to this message ]



    Re: bulk deleting users solaris 7 NIS  
Chris F.A. Johnson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-03-05 07:49 AM

On 2005-09-02, discussie@vandehoedenderand.nl wrote:
> I have inherited the administration over a SUN Sparc Solaris machine
> on a school. This machine has 2800 userids defined and only 1500 of
> them are in use. How can I easily delete, (perlscript maybe?) my
> surplus of 1300 userid from the NIS databases. I have managed to
> compile a list of userids that can be removed so the input can be
> read from file. Can you please point me in the right direction as
> to how I can do that. Or better yet have a ready solution for me.

Make the entries in the file of the format:

^USERNAME1:
^USERNAME2:

If you just have the names by themselves, a simple awk script can
fix them:

awk '{printf "^%s:\n", $1}' FILE > FILENAME

And use:

grep -Evf FILENAME /var/yp/shadow > newshadow
mv newshadow /var/yp/shadow

Then build the NIS database.

On an older Solaris you may have to use egrep instead of grep -E.

Adjust file names to taste.

--
Chris F.A. Johnson                     <http://cfaj.freeshell.org>
 ========================================
==========================
Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress
<http://www.torfree.net/~chris/books/cfaj/ssr.html>





[ Post a follow-up to this message ]



    Re: bulk deleting users solaris 7 NIS  
Birch


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-03-05 12:50 PM

Thank you very much for this solution. I will try this first thing
mondaymorning.
Do I need to do the same with /var/yp/passwd? Or will the makefile for
building the NIS database take charge of that?

Thanks again.

Regards,
Peter Berkhout.






[ Post a follow-up to this message ]



    Re: bulk deleting users solaris 7 NIS  
Birch


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-05-05 11:00 PM

I did the task this mornig. All went well. To answer my own question.
Yes the same has to be done with the passwd file.
Thanks again.
Regards,
Peter Berkhout






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:28 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register