Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

etc/passwd

Status
Not open for further replies.

simanek

Programmer
Jan 19, 2001
137
0
0
US
Is there a way to write a script to check different equivalents of etc/passwd located in different places? If so, where would i put such a script and how would I get it to run (i'm guessing the last question would be in a runlevel...but i'm not sure). Any tips on writing it would be appreciated too =^). Thanks.

simanek
 
You will have to be more specific on what you want the script to do in order for anyone to help you on it. As far as where to run it from - you can create a crontab for yourself and schedule it to run from there. You can put it in the rc's but it would only run then when you change run levels.
 
basically i have two web servers running on two different ip addresses (1 machine). We have two separate user passwd files mounted off of another machine. When someone looks up a web page by we want only those users who are in the passwd file for somedomain1 to have their files shared while if the person were to look at they would have a different list of users. Note that all user files have been mounted to a single directory. I also do NOT want these users added to /etc/passwd. Is that much clearer? Sorry for the previous confusion.

simanek
 
If I am clear I think the you should use the IP address to drilldown to the password file that is to be used...
 
Well, I've solved my probelm. For future reference for everyone, the key is in a c library called getpwent.c. It is from UC Berkeley and builds a gigantic hash table of your users. This library can be used to direct where your passwd file is (more or less). Thanks for the help though fellas.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top