Pull Netgroup from Servers

Hi, How to pull netgroup from all servers

I think the netgroup resides in /etc/security/access.conf so I want to know how to get the list of netgroup in all the servers.

I have a jump server I can run the script from there to get the list but not sure how to do the script. Any ideas or starting point?

I am not sure what you mean by "netgroup". If you mean NIS-groups they are stored in /etc/netgroup on AIX and i suppose on other systems too - if you could tell us your OS we could probably give better/less generalised advice.

How about something like:

#! /bin/ksh

typeset fList="/path/to/list"      # list of server names to process
typeset fWork=/my/work/directory"
typeset chServer=""


while read chServer ; do
     if ! scp "root@${chServer}":/etc/netgroup "${fWork}/netgroup.${chServer}" ; then
          print -u2 - "Error processing Server $chServer"
     else
          cat "${fWork}/netgroup.${chServer}" >> "${fWork}/complete.list
     fi
done < "$fList"

exit 0

There sure is much to be done on this script skeleton, but it should work as a starting point.

I hope this helps.

bakunin

1 Like