NIS login discrepancy


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers NIS login discrepancy
# 1  
Old 03-25-2003
NIS login discrepancy

I have a query in relation to a couple of machines I have set up. We will call them machine SUN and HPUX and they are running those operating systems respectively. The SUN machine is acting as an NIS server and the HPUX machine as an NIS client. Now the HPUX machine also has a an auto mounted file system from a 3rd machine (call it 3SYS). The system of accounts and home directories which have been set up on this is curious. The NIS accounts which have been set up have the home directories located in several places. Some accounts have the home directory located on the NIS server itself ( i.e. on SUN) some have the home directories located on the mounted files system of HPUX ( i.e. on 3SYS). This leads to some fun depending where you log in from and this is where this query is going.

As all of these accounts are NIS accounts the password files will be pushed to all machines which are clients slaves or masters. IN all the cases below I have logged onto the machine in question as root and then tried to su - to an account so when I say log on I really mean su - account.

If you log on to the SUN ( the NIS server) with an account which has a home directory on SUN everything works fine as expected. However if you log onto SUN using an account which has its home directory on SYS3 I get an error message saying "NO directory !" and it kicks me back into the acccount I just tried to change from. This is not unexpected as it can see the password map but not the home directory.

Conversely if I log onto HPUX and try to log onto an account which has it's home directory located on the automounted file system ( i.e. SYS3) everything works OK as you would expect. However if I am on HPUX and I try to log onto an account which has it's home directory on SUN then I am able to log in as that user but I stay in the home directory of the account which I just tried to log in from.

What is causing the discrepancy between these two situations. In summary.

HPUX -> login to account -> home dir on another machine -> login ok but stay in existing directory

SUN -> login to account -> home directory on another machine -> login not ok and kicked out to previous account

Any ideas ???
# 2  
Old 03-25-2003
Each OS handles things differently. Since SUN is more strict with NIS, if you have no directory or no shell, you can't log in. HP is more forgiving and it gives you a "loaner" shell or directory in some cases. AIX acts differently then either of these. If you mount SYS3 home directories to HPUX and SUN then you should not2have any issues regarding the directory. What entries do you have on both systems in /etc/passwd and /etc/group that start with a +? Some users, groups, or netgroups may be allowed/denied access which can though another wrench into the picture.
# 3  
Old 03-27-2003
Are you saying that the ability to login using this "loaner shell" is OS dependant and not configurable ??

In response to you're question the HPUX has the following entries

+::0:0::: in the /etc/passwd file and
+: in the /etc/group file

I am not quite sure what these entries do. There are no such entries in the sun sytems equivalent files.
# 4  
Old 03-27-2003
You might also check your /etc/shadow file - it should also have the + (you can check out the man page (section 4) for passwd

From a SUN server at my site:

/etc/passwd ends with
+:x:::::

/etc/shadow
+@all-users::::::::

We use netgroups in NIS so our /etc/group does not contain a + but /etc/nsswitch.conf has the following:


passwd: compat
group: files nis
hosts: files dns
ipnodes: files
networks: files nis
protocols: files nis
rpc: files nis
ethers: files nis
netmasks: files nis


An HP server at this site:

/etc/passwd:
+::-24:-24:::

/etc/shadow:
+:x:::::

/etc/nsswitch.conf
passwd: files nis
hosts: files [NOTFOUND=continue] dns
services: files
protocols: files
networks: files
rpc: files
netgroup: files nis
# 5  
Old 03-28-2003
I don't know if the "Loaner" shell is configurable or not, I just know the default is different for different OSes.

Since the Sun system is the NIS server, it is likely it is using the /etc/passwd and /etc/group to build the NIS maps which means you wouldn't need the + entries in those files. This can be changed however and point to any location you like.
# 6  
Old 03-28-2003
This has actually made me think a bit more about the passwords situation for NIS on SUN and HPUX. I did a bit of digging and it brought up more questions

From what I could see in the man pages and in some websites the idea for having an nsswitch.conf file was to avoid having the entry "+" in the /etc/passwd and /etc/group files to enable nis and that once you had entries in /etc/nsswitch.conf for passwd and group it overrides the + entries in the /etc/passwd and /etc/group files. I decided to try this out and find out if this was correct (I also wanted to check out what the comport entry in the nsswitch file was for).

What I tried to do is to change the entry in the nsswitch.conf file for passwd from

passwd files nis
to
passwd files

This was to see if I needed to stop and restart the client when changes were made. I tried to log into an nis account subsequant to this change and as expected I couldn't.

I then put the entry back to

passwd files nis

and when I went to log into the nis account everything was now ok.

What I wanted to do next was to disable the entry in the nsswitch.conf by putting # infrom of the passsword entry. The idea was then to check if I could log into the nis account and then if it failed as I expected it to I was going to ad various + type entries to the passwd file. However I found that even if I put a # in front of the passwd entry in the nsswitch.conf file of removed it or even deleted the nsswitch.conf file itself I could log into an nis account I wanted.

I don't know how this is possible if there is no entry or no file anmd there are no + type entries in the passwd file.

Any thoughts ???

P.S. I also noticed when looking into this on HPUX that if you do a man on passwd it gives an example where the entry for nis which is

+:::Guest.

Normally the entry after 3 colons is the group id what is it here. It mentions the pw_gecos of Guest. It says that it contains user info but I am not sure what that is and why it is located where the group id entry should be as there are no man files specifically on it.
# 7  
Old 03-31-2003
has anyone any thoughts on the previous entry in this thread ?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Ssh not allowing NIS user to login

As I do a ssh <nis_user>@server1 from server2, ssh prompts for certificates (as expected the first time), then it prompts for the users password, as soon as I enter the password, I get a Connection to server1 closed by remote host, and connection to server1 closed. and I disconnect back to the... (3 Replies)
Discussion started by: mrmurdock
3 Replies

2. OS X (Apple)

RAM Usage discrepancy

Hey there! I'm a new user here who registered because I couldn't get these kind of questions answered in the place I directly com from. :o I've found a discrepancy in total RAM used and I can't figure out why it is. My only guess is there are some RAM used by some stuff impossible to identify,... (2 Replies)
Discussion started by: dasx
2 Replies

3. AIX

AIX: Could not login using NIS Account?

Hi there, I am new to AIX environment, when I set up NIS Client for an AIX 5.3 Machine to connect to a Linux NIS Master, everything seems to be okie: /etc/passwd: +::0:0::: /etc/group: +: ps -ef | egrep "ypbind": /usr/lib/netsvc/yp/ypbind -ypsetme -ypsetme I can get all account... (0 Replies)
Discussion started by: quanba
0 Replies

4. Solaris

NIS - Change Password @ first login.

Hi Any body knows how to prompt user to change password on first login in a Solaris NIS client. Thanks HG (3 Replies)
Discussion started by: Hari_Ganesh
3 Replies

5. Shell Programming and Scripting

Validating that the NIS and NIS+ services are disabled

I'm creating a scrip for auditing our AIX box's to ensure that they are built according to our system standards. I'm not sure on the logic for checking to see if the NIS and NIS+ services are disabled. any idea's? (2 Replies)
Discussion started by: sport
2 Replies

6. Solaris

Incorrect login NIS?

Hello, I have an issue with a NIS client station on my network. I can't log onto with any NIS login and it prompt "Login incorrectl please try again". My others stations work correctly and log on without problem. This station worked correctly before yesterday, but yesterday we've got a power... (5 Replies)
Discussion started by: Juterassee
5 Replies

7. Solaris

How to configure a NIS client bound to the NIS server in another subnet?

Hi, all. I have a Solaris client here needs to bind to NIS server in another subnet. Following is the configuration i made on the client, 1) edit /etc/inet/hosts to add an entry of the NIS server -- nserver01 2) execute `domainname` to set local NIS domain to the domain of the NIS server.... (1 Reply)
Discussion started by: sn_wukong
1 Replies

8. UNIX for Advanced & Expert Users

SUSE 9 and 10 NIS clients with RedHat 8.0 NIS server not working

We have a RedHat 8.0 NIS master, with a RedHat 8.0 NIS Slave. We also have a small number of SUSE 9.1 and SUSE 10 machines here for evaluation. However, no matter what i do, the SUSE machines will not talk to the NIS Servers. If i broadcast for NIS Servers for the specified NIS domain, it... (1 Reply)
Discussion started by: fishsponge
1 Replies

9. UNIX for Dummies Questions & Answers

NIS map mail.aliases specified, but NIS not running

Hi all, I just took over the admin role from someone and I wanna setup sendmail (just to send mail from the host) however, after I config all the resolv.conf, nssitch.conf, hosts file and when I try to send a mail out, after I punched ctl-D, it returned he following, "NIS map mail.aliases... (2 Replies)
Discussion started by: stancwong
2 Replies

10. UNIX for Advanced & Expert Users

NIS users cann't login on AIX and HP

Hey, I've set up a NIS domain with linux as master-server, slave server and clients ... and Linux works fine. To that NIS domain I tried to add a HPUX 11.00 and an AIX 4.3.3 system (till now - there should be more clients in final version). And both systems now have to same problem: I can... (3 Replies)
Discussion started by: mod
3 Replies
Login or Register to Ask a Question