LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 03-27-2008, 01:58 AM   #1
expatCM
Member
 
Registered: Apr 2006
Location: Chiang Mai, Thailand
Distribution: Ubuntu 9.04 64 bit
Posts: 101

Rep: Reputation: 15
Really simple NIS problem


I have set up the client and the server but I do not see how to use NIS.

What I am expecting is to have the same id on both client and server. What happens is that the client has one id and the server has another.

From a client if I run rpcinfo -p and rpcinfo -p nisdomain or ip I see all the necessary processes loaded.

If from the client I run ypmatch user passwd I get the server id which is what I want.

If I putty to the server and use id user I get the same id. If I run id user on the client I get the local id and I was anticipating the server id.

I think I did not do something but I do not know what that is. Can anyone tell me? Do I have to run a process to synchronize the client passwords for example?

This is on Ubuntu 7.10 if that is important.
 
Old 03-27-2008, 07:34 PM   #2
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
1. what does your /etc/nsswitch look like?

2. does the user in question exist in the /etc/passwd file on both the client and server?

suggestions without knowing the above:
in /etc/nsswitch, you should have something like:

Code:
passwd:         nis files
group:          nis files
shadow:         nis files
and the user should probably not exist in the client /etc/passwd.

also, be sure you "make -C /var/yp" when you add new users on the server.

Also note that after you get this working, the user will probably not be able to log into the client machine as their home dir will no longer belong to them until you straighten out the owner (it will be mapped to the old UID).

Last edited by BrianK; 03-27-2008 at 08:09 PM.
 
Old 03-27-2008, 11:51 PM   #3
expatCM
Member
 
Registered: Apr 2006
Location: Chiang Mai, Thailand
Distribution: Ubuntu 9.04 64 bit
Posts: 101

Original Poster
Rep: Reputation: 15
Thanks for your help.

It looks like NIS only does not work where the user already exists on the client machine. If I have two users, Tom and Dick. If Tom exists on both the server and the client then I only ever get the client ID on the client. In the case of Dick who does not exist on the client then “id dick” on the client shows the server id.

(to answer your question directly, Yes the user exists in the passwd file on both the client and server)

But now I am confused. What would I do to straighten out Tom's home directory if I take him out of the client password list. Presumably I copy the home directory content to the server home directory and use NFS in order to keep all of the programs and settings for Tom working?

The nsswitch files are as follows

Server

Code:
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat nis
group:          compat nis
shadow:         compat nis

hosts:    	files nis dns
networks:       files

protocols:      db files
publickey	nisplus
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis
Client

Code:
# /etc/nsswitch.conf

#

# Example configuration of GNU Name Service Switch functionality.

# If you have the `glibc-doc-reference' and `info' packages installed, try:

# `info libc "Name Service Switch"' for information about this file.



passwd:         compat

group:          compat

shadow:         compat



hosts:          files mdns4_minimal [NOTFOUND=return] nis dns mdns4

networks:       files



protocols:      db files

services:       db files

ethers:         db files

rpc:            db files



netgroup:       nis db files
 
Old 03-28-2008, 03:13 PM   #4
PDock
Member
 
Registered: Aug 2004
Distribution: Slack10 & curr. tried numerous
Posts: 189

Rep: Reputation: 36
nis search not find this link

Digest the information found in this link which I suspect did not come up in your search on NIS

http://www.linuxquestions.org/questi...&highlight=nis

Come back with questions

ppd
 
Old 03-28-2008, 04:32 PM   #5
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
Quote:
Originally Posted by expatCM View Post
Thanks for your help.

It looks like NIS only does not work where the user already exists on the client machine. If I have two users, Tom and Dick. If Tom exists on both the server and the client then I only ever get the client ID on the client. In the case of Dick who does not exist on the client then “id dick” on the client shows the server id.

(to answer your question directly, Yes the user exists in the passwd file on both the client and server)

But now I am confused. What would I do to straighten out Tom's home directory if I take him out of the client password list. Presumably I copy the home directory content to the server home directory and use NFS in order to keep all of the programs and settings for Tom working?

The nsswitch files are as follows

Server

Code:
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat nis
group:          compat nis
shadow:         compat nis

hosts:    	files nis dns
networks:       files

protocols:      db files
publickey	nisplus
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis
Client

Code:
# /etc/nsswitch.conf

#

# Example configuration of GNU Name Service Switch functionality.

# If you have the `glibc-doc-reference' and `info' packages installed, try:

# `info libc "Name Service Switch"' for information about this file.



passwd:         compat

group:          compat

shadow:         compat



hosts:          files mdns4_minimal [NOTFOUND=return] nis dns mdns4

networks:       files



protocols:      db files

services:       db files

ethers:         db files

rpc:            db files



netgroup:       nis db files
the nsswitch on your client is not explicitly asking to look at NIS first. This is why the local passwd file takes precedence. change it to "nis files" or at least "nis compat" & you'll always get the server UID first. That said, there's probably something more to compat, so I would do some research on that.

as far as fixing the home dir, simply change ownership of it once you're using the server's UIDs, i.e. if "id DICK" gives back the correct server UID for dick, then simply (as root):

cd /home
chown -R dick dick
chgrp -R dick dick
 
Old 03-30-2008, 04:17 AM   #6
expatCM
Member
 
Registered: Apr 2006
Location: Chiang Mai, Thailand
Distribution: Ubuntu 9.04 64 bit
Posts: 101

Original Poster
Rep: Reputation: 15
I think the problem / solution is the order you do things.

I set my network up by getting the clients working first and then taking the server in gradual steps. This means that the user names on the client machines already exist and it would appear that with NIS you cannot have the same user name on client and server. But you cannot kill all user names on the client or you can never get in should the server not be available.

So it appears what is needed is to set up new users on the server and use those from the clients.

This seems to be a really clumsy approach but since there are many weaknesses in NIS / NFS anyway perhaps I should not be too critical ....
 
  


Reply

Tags
networking, nis, ubuntu


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NIS: NIS running but users not able to log in with NIS credentials outerspace Linux - Server 3 10-17-2007 08:51 AM
Simple (?) NIS problem digdoug Linux - Networking 0 01-19-2007 02:31 PM
SUSE 9 and 10 NIS clients with RedHat 8.0 NIS server not working fishsponge Linux - Networking 0 11-29-2005 07:43 AM
NIS-Problem - search for NIS-Guru or SuSE Profesional krischeu MEPIS 0 06-16-2005 07:21 AM
How to setup a solaris NIS client while with a Linux NIS server? ntcm Linux - Security 2 03-31-2004 12:43 PM


All times are GMT -5. The time now is 12:00 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration