archive:emt251
Differences
This shows you the differences between two versions of the page.
| archive:emt251 [2026/02/08 03:46] – created - external edit 127.0.0.1 | archive:emt251 [2026/09/04 16:30] (current) – azman | ||
|---|---|---|---|
| Line 225: | Line 225: | ||
| * either restart the machine or as root, type <code bash> | * either restart the machine or as root, type <code bash> | ||
| * we can alternatively use autofs, but I thought this is much easier | * we can alternatively use autofs, but I thought this is much easier | ||
| - | |||
| - | ====== NIS on Slackware ====== | ||
| - | |||
| - | Got this from [[http:// | ||
| - | |||
| - | <file text> | ||
| - | Slackware-NIS-mini-HOWTO | ||
| - | How to set up a NIS server and configure NIS clients on Slackware Linux | ||
| - | 14-Dec-2000 | ||
| - | David Cantrell < | ||
| - | |||
| - | |||
| - | ============== | ||
| - | THE NIS SERVER | ||
| - | ============== | ||
| - | |||
| - | STEP 1: Decide which machine will be the NIS server | ||
| - | ---------------------------------------------------- | ||
| - | |||
| - | This is usually not a very involving process, but does require some | ||
| - | thought. | ||
| - | does not need to reboot into other operating systems. | ||
| - | existing fileserver, that would be a good choice for your NIS server. | ||
| - | |||
| - | |||
| - | STEP 2: Decide on what you want NIS to serve | ||
| - | --------------------------------------------- | ||
| - | |||
| - | NIS is fairly complex. | ||
| - | information. | ||
| - | network services that should be running. | ||
| - | NIS as a common user logon authetication system. | ||
| - | use is to have it share NFS automount maps so that users logging in on a | ||
| - | system will have their home directory automounted for them. | ||
| - | |||
| - | In this mini-HOWTO, I will explain how to set up your NIS server and | ||
| - | clients for passwd/ | ||
| - | |||
| - | |||
| - | STEP 3: Move home directories to sharing location | ||
| - | -------------------------------------------------- | ||
| - | |||
| - | In order to make the home directory NFS shares work seamlessly across the | ||
| - | NIS server and clients, I move them to / | ||
| - | they will be mounted on the client, so I make them exist there on the | ||
| - | server as well. You might not have /export on your server, so let's make | ||
| - | it: | ||
| - | |||
| - | mkdir -p /export | ||
| - | |||
| - | Now make the home directory location: | ||
| - | |||
| - | mkdir / | ||
| - | |||
| - | Now move all your home directories over to / | ||
| - | " | ||
| - | site specific. | ||
| - | / | ||
| - | |||
| - | mv /home/* / | ||
| - | mv / | ||
| - | |||
| - | |||
| - | STEP 4: Edit home directory paths on the server | ||
| - | ------------------------------------------------ | ||
| - | |||
| - | Since home directories are now in / | ||
| - | /etc/passwd on the server to reflect those locations. | ||
| - | called " | ||
| - | / | ||
| - | |||
| - | |||
| - | STEP 5: Write the automount maps | ||
| - | --------------------------------- | ||
| - | |||
| - | I usually make two automount maps for the home directories. | ||
| - | auto.master and controls how the automounter works. | ||
| - | auto.export and will describe the /export map. | ||
| - | |||
| - | Edit / | ||
| - | |||
| - | |||
| - | # | ||
| - | # auto.master - Master map file for NFS automounter | ||
| - | # | ||
| - | |||
| - | / | ||
| - | |||
| - | |||
| - | Now edit / | ||
| - | |||
| - | |||
| - | # | ||
| - | # auto.export - NFS automounter configuration file | ||
| - | # | ||
| - | |||
| - | # Home directories | ||
| - | home -fstype=nfs <NFS/NIS server>:/ | ||
| - | |||
| - | |||
| - | Of course, replace <NFS/NIS server> with the hostname of your NFS/NIS | ||
| - | server. | ||
| - | |||
| - | |||
| - | STEP 6: Edit the NFS exports file on the server | ||
| - | ------------------------------------------------ | ||
| - | |||
| - | Now we need to make sure that /export is shared from the server. | ||
| - | / | ||
| - | |||
| - | |||
| - | / | ||
| - | |||
| - | |||
| - | Save the file and restart the NFS server daemons: | ||
| - | |||
| - | | ||
| - | |||
| - | |||
| - | STEP 7: Pick a name for your NIS domain | ||
| - | ---------------------------------------- | ||
| - | |||
| - | Each NIS domain needs to have a unique name. Do not use the same name as | ||
| - | your DNS domain. | ||
| - | in this example. | ||
| - | |||
| - | Edit / | ||
| - | |||
| - | |||
| - | mynis | ||
| - | |||
| - | |||
| - | Save and exit. The name of your NIS domain shoulw be the only thing in | ||
| - | that file. Once you've done that, set the NIS domain with this command: | ||
| - | |||
| - | | ||
| - | |||
| - | |||
| - | STEP 8: Edit / | ||
| - | ------------------------------ | ||
| - | |||
| - | The NIS server has a Makefile that controls what maps are served out by | ||
| - | NIS. Each time you make a change (such as adding a user), you should go | ||
| - | into /var/yp and type " | ||
| - | |||
| - | In this file we need to edit the all: target and specify the stuff we want | ||
| - | to share. | ||
| - | |||
| - | all: passwd group hosts rpc services netid protocols netgrp mail \ | ||
| - | shadow auto.master auto.export | ||
| - | |||
| - | Now find the line that looks like this: | ||
| - | |||
| - | | ||
| - | |||
| - | We want to add this line just after that line: | ||
| - | |||
| - | | ||
| - | |||
| - | Now find the auto.local: target. | ||
| - | that target: | ||
| - | |||
| - | | ||
| - | | ||
| - | -@sed -e "/ | ||
| - | -i $(AUTO_EXPORT) -o $(YPMAPDIR)/ | ||
| - | -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@ | ||
| - | |||
| - | Save the Makefile and exit. | ||
| - | |||
| - | |||
| - | STEP 9: Edit / | ||
| - | -------------------------------- | ||
| - | |||
| - | Edit / | ||
| - | something like this: | ||
| - | |||
| - | | ||
| - | |||
| - | You should specify your network address and submask there, this is only | ||
| - | an example. | ||
| - | 192.168.1 class C subnet. | ||
| - | |||
| - | |||
| - | STEP 10: Create an / | ||
| - | ----------------------------------------- | ||
| - | |||
| - | The only line you need in this file is: | ||
| - | |||
| - | dns: yes | ||
| - | |||
| - | This line tells ypserv to resolve hostnames using a DNS server instead of | ||
| - | relying on NIS hostname maps (which you probably aren't using). | ||
| - | exit. | ||
| - | |||
| - | |||
| - | STEP 11: Start ypbind | ||
| - | ---------------------- | ||
| - | |||
| - | Start ypbind: | ||
| - | |||
| - | / | ||
| - | |||
| - | Use ps to make sure it started and is running properly. | ||
| - | see a master and slave process for it. | ||
| - | |||
| - | |||
| - | STEP 12: Start ypserv | ||
| - | ---------------------- | ||
| - | |||
| - | Start ypserv: | ||
| - | |||
| - | / | ||
| - | |||
| - | Use ps to make sure it started and is running properly. | ||
| - | |||
| - | |||
| - | STEP 13: Initialize the NIS maps | ||
| - | --------------------------------- | ||
| - | |||
| - | We need to initialize the NIS maps with this command: | ||
| - | |||
| - | / | ||
| - | |||
| - | Fill in the blanks for all machines on your network that will be acting as | ||
| - | NIS servers. | ||
| - | make sure that users on NIS clients can run chfn and passwd. | ||
| - | |||
| - | |||
| - | STEP 14: Done, making sure NIS stuff loads at bootup | ||
| - | ----------------------------------------------------- | ||
| - | |||
| - | Your NIS server is now up and running. | ||
| - | and make sure the following block is uncommented: | ||
| - | |||
| - | # Setting up NIS: | ||
| - | # (NOTE: For detailed information about setting up NIS, see the documentation | ||
| - | # in / | ||
| - | # | ||
| - | # First, we must set the NIS domainname. | ||
| - | # necessarily the same as your DNS domainname, set in | ||
| - | # / | ||
| - | # served by your NIS server. | ||
| - | |||
| - | if [ -r / | ||
| - | | ||
| - | fi | ||
| - | |||
| - | # Then, we start up ypbind. | ||
| - | |||
| - | if [ -d /var/yp ] ; then | ||
| - | echo -n " ypbind" | ||
| - | | ||
| - | fi | ||
| - | |||
| - | # If you are the NIS master server for the NIS domain, then | ||
| - | # you must run rpc.yppasswdd, | ||
| - | # lets users change their passwords. | ||
| - | |||
| - | if [ -x ${NET}/ | ||
| - | echo -n " yppasswdd" | ||
| - | | ||
| - | fi | ||
| - | |||
| - | It's probably adviseable to run rpc.yppasswdd with this line: | ||
| - | |||
| - | | ||
| - | |||
| - | This ensures that chfn and chsh work. You also need to add this after the | ||
| - | ypbind if block: | ||
| - | |||
| - | if [ -x ${NET}/ | ||
| - | echo -n " ypserv" | ||
| - | | ||
| - | fi | ||
| - | |||
| - | The ypserv program needs to run on the NIS server. | ||
| - | |||
| - | |||
| - | |||
| - | ============== | ||
| - | THE NIS CLIENT | ||
| - | ============== | ||
| - | |||
| - | STEP 1: Set the NIS domain | ||
| - | --------------------------- | ||
| - | |||
| - | Edit / | ||
| - | of your NIS domain. | ||
| - | |||
| - | |||
| - | STEP 2: Edit / | ||
| - | -------------------------- | ||
| - | |||
| - | Open / | ||
| - | |||
| - | | ||
| - | |||
| - | Specify either the IP address or hostname of your NIS server. | ||
| - | don't have working hostnames, you must use the IP address here. | ||
| - | |||
| - | |||
| - | STEP 3: Set the NIS domain | ||
| - | --------------------------- | ||
| - | |||
| - | Set the NIS domain by typing this command: | ||
| - | |||
| - | | ||
| - | |||
| - | |||
| - | STEP 4: Run ypbind | ||
| - | ------------------- | ||
| - | |||
| - | Start ypbind with this command: | ||
| - | |||
| - | / | ||
| - | |||
| - | |||
| - | STEP 5: Test the NIS connection | ||
| - | -------------------------------- | ||
| - | |||
| - | See if the NIS server is working with this command: | ||
| - | |||
| - | ypcat passwd.byname | ||
| - | |||
| - | If you see the /etc/passwd entries from the NIS server, you're good to go. | ||
| - | Otherwise, go back to the NIS server section and see if you missed any | ||
| - | steps. | ||
| - | |||
| - | |||
| - | STEP 6: Edit / | ||
| - | -------------------------------- | ||
| - | |||
| - | You need to edit / | ||
| - | shadow, and group. | ||
| - | |||
| - | db files nis | ||
| - | |||
| - | Change the automount entry to: | ||
| - | |||
| - | files nis | ||
| - | |||
| - | |||
| - | STEP 7: Enable NIS logins in /etc/passwd and /etc/group | ||
| - | -------------------------------------------------------- | ||
| - | |||
| - | Edit /etc/passwd and add this line to the end: | ||
| - | |||
| - | | ||
| - | |||
| - | Edit /etc/group and add this line to the end: | ||
| - | |||
| - | +::: | ||
| - | |||
| - | |||
| - | STEP 8: Create the /export directory for home directory mounting | ||
| - | ----------------------------------------------------------------- | ||
| - | |||
| - | Make sure you have that directory: | ||
| - | |||
| - | mkdir -p /export | ||
| - | |||
| - | |||
| - | STEP 9: Create an rc.autofs script | ||
| - | ----------------------------------- | ||
| - | |||
| - | The included rc.autofs script should be moved into / | ||
| - | rc.local and add this line: | ||
| - | |||
| - | / | ||
| - | |||
| - | |||
| - | STEP 10: Done, enable NIS stuff at bootup | ||
| - | ------------------------------------------ | ||
| - | |||
| - | Your NIS client is now configured. | ||
| - | this block: | ||
| - | |||
| - | # Setting up NIS: | ||
| - | # (NOTE: For detailed information about setting up NIS, see the documentation | ||
| - | # in / | ||
| - | # | ||
| - | # First, we must set the NIS domainname. | ||
| - | # necessarily the same as your DNS domainname, set in | ||
| - | # / | ||
| - | # served by your NIS server. | ||
| - | |||
| - | if [ -r / | ||
| - | | ||
| - | fi | ||
| - | |||
| - | # Then, we start up ypbind. | ||
| - | |||
| - | if [ -d /var/yp ] ; then | ||
| - | echo -n " ypbind" | ||
| - | | ||
| - | fi | ||
| - | </ | ||
archive/emt251.txt · Last modified: by azman
