Centralized Authorization Using a Directory Service, Part II
to the file /etc/sysconfig/network.
Restrict access to your new NIS server by creating a file /var/yp/securenets with the content:
# netmask # network 255.255.255.0 192.168.0.0
This is a crucial security step. The world is able to query your NIS server if you don't have this file.
The next step is to define the things you would like to put into NIS. For the purpose of authorization, the /etc/group and /etc/passwd files as well as something called netgroup are sufficient. However, many more things are possible. To get an idea, have a look at the file /var/yp/Makefile on your NIS server.
Below, I show how the three files I've mentioned are configured to be distributed by way of NIS.
Adjust the Makefile generating the NIS map database files:
# cp /var/yp/Makefile /var/yp/Makefile.save # vi /var/yp/Makefile
Change the following two entries from true to false to prevent the merging of passwd and shadow files as well as group and gshadow files:
MERGE_PASSWD=false MERGE_GROUP=false
Change the directory name where NIS should look for its data sources:
YPSRCDIR = /etc/NIS YPPWDDIR = /etc/NIS
Comment all files from which the NIS databases should not be built. I left only these three files:
GROUP = $(YPPWDDIR)/group PASSWD = $(YPPWDDIR)/passwd NETGROUP = $(YPSRCDIR)/netgroup
Comment the line starting with all: that contains the list of all potential NIS maps. Add the new line:
all: passwd group netgroup
Watch out for TAB characters. In a Makefile, you must use only TAB characters, not spaces, to indent commands.
Now, create the data source directory defined in the Makefile:
# mkdir /etc/NIS/ # chmod 700 /etc/NIS
and put a passwd file in there:
# grep -v '^root' /etc/passwd > /etc/NIS/passwd
You should remove not only the root account but all system accounts from this file and leave only the real user accounts.
If you still are using /etc/passwd with encrypted passwords, it now is time to convert them to Kerberos 5, as described in the previous article [LJ, February 2005]. If you don't do this, your encrypted passwords are exposed on the network when the passwd file is distributed to the slave NIS servers or to the NIS clients.
Now, collect the local /etc/passwd files from all the machines that are to be members of your new NIS domain. Remove all system accounts and then merge them together with:
% cat passwd_1 passwd_2 passwd_3 ... > passwd_merge
Remove all duplicate entries with this command:
% sort passwd_merge | uniq > passwd_uniq
Check the consistency of the remaining entries with:
% cut -d':' -f1 passwd_uniq | sort | uniq -c | \ egrep -v "\s*1"
If this produces any output, you have two different entries with the same account name. If the difference is not in the UID or GID field, simply decide on one of the entries and remove the other one. If the difference is the UID or GID field, you need to resolve this conflict, which can be rather complex.
Another consistency check is to see whether any two different accounts have the same UID, which is the case if this command:
% cut -d':' -f3 passwd_uniq | sort | uniq -c | \ egrep -v "\s*1"
produces any output; the second number in the output is the duplicate UID. Resolving this conflict again can be rather complex. Do the same kind of merging and checking for all your /etc/group files.
Copy the resulting files to /etc/NIS/passwd and /etc/NIS/group. I will return to the netgroup file later. Leave it out for now.
Now, start your master NIS server with:
# service ypserv start
Initialize the NIS maps with the command:
# /usr/lib/yp/ypinit -m
and follow the printed instructions.
In order to have all the NIS maps available to your NIS master server, you probably want to set up this machine as an NIS client as well. Make sure this NIS client can bind only to the NIS master as server in order to prevent circular dependencies when booting all your machines, as after a power outage.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- One Hand Slapping
- Home, My Backup Data Center
- What's the tweeting protocol?
- RSS Feeds
- Readers' Choice Awards 2011
- Trying to Tame the Tablet
- Reply to comment | Linux Journal
4 hours 21 min ago - Reply to comment | Linux Journal
6 hours 54 min ago - Reply to comment | Linux Journal
8 hours 11 min ago - great post
8 hours 46 min ago - Google Docs
9 hours 8 min ago - Reply to comment | Linux Journal
13 hours 57 min ago - Reply to comment | Linux Journal
14 hours 44 min ago - Web Hosting IQ
16 hours 17 min ago - Thanks for taking the time to
17 hours 54 min ago - Linux is good
19 hours 52 min ago




Comments
Part I Please
can you post the link for the Part I of this article?
thanks & regards
shann
massoo@30gigs.com
massoo@gmail.com
Links
Central Authentication with Kerberos 5
http://www.linuxjournal.com/article/7336 (Part I)
Centralized Authorization Using a Directory Service
http://www.linuxjournal.com/article/7334 (Part II)
AFS - A Secure Distributed Filesystem
http://www.linuxjournal.com/article/7521 (Part III)
Was a bit confusing since the article titles are all different.