1832645 Members
3088 Online
110043 Solutions
New Discussion

Re: NIS user problem

 
Leonid Mishkind
Frequent Advisor

NIS user problem

Hi All .
I have a user defined in a NIS.
When I am logged in to a server this is the output of the id command:
root@aux1> id omar
uid=333(omar) gid=20(users)
su to the user works fine as well...But, when I run commands like :
root@aux1> cd ~omar
sh: ~omar: not found.
root@aux1> chown -R omar:users omar
chown: unknown user id omar

Well, you can see the result for yourself ...
I did a restart for nis/pwgr and no improvement .
Please help.
Leonid.

14 REPLIES 14
Steven Schweda
Honored Contributor

Re: NIS user problem

What do you get from commands like these?

grep omar /etc/passwd

ypcat passwd | grep omar

grep passwd /etc/nsswitch.conf

palaniappan.sp
Regular Advisor

Re: NIS user problem

Hi,
R u having sudo access??If u r having try login with ur NIS id on one server and add sudo in front of every command.
Is ur home directory created in san or in server.And that is auto mounted?? when ur logging??
Then try that commands what steven had given ..

Regds
Palani



Everything is Possible and Anything is Feasible if u try
Leonid Mishkind
Frequent Advisor

Re: NIS user problem

Thanks for the replies.
1 . No sudo
2. No Automount
3. The home dir is SAN device.
4. root@aux1> ypcat passwd | grep -i omar
omar:*:333:20:arda omar,55167,,:/users/omar:/bin/tcsh
Steven Schweda
Honored Contributor

Re: NIS user problem

Ok. That's one of the three things for which
I asked. Let's assume for the moment that I
really didn't care about the others. What
about these?

ls -ld /users/omar

ls -l /users/omar

Can I assume that "cd ~root" works, and that
you aren't using some obsolete shell which
doesn't understand "~user_name"?
Leonid Mishkind
Frequent Advisor

Re: NIS user problem

I am working with user root which has /sbin/sh.
root@aux1> ls -ld /users/omar
lrwxr-xr-x 1 root sys 16 Dec 13 09:54 /users/omar -> /aux1/users/omar

root@aux1> ls -ld /aux1/users/omar
drwxr-xr-x 2 root sys 96 Dec 13 09:54 /aux1/users/omar
root@aux1>

root@aux1> ls -l /users/omar/
total 64
-r--r--r-- 1 root sys 832 Dec 13 09:54 .cshrc
-r--r--r-- 1 root sys 347 Dec 13 09:54 .exrc
-r--r--r-- 1 root sys 334 Dec 13 09:54 .login
-r--r--r-- 1 root sys 439 Dec 13 09:54 .profile

The files are with root permissions since I cant chown to the user :).
about the other things ( I really thought you will not care to much )...
root@aux1> grep -i omar /etc/passwd
root@aux1>

passwd: files [NOTFOUND=continue] nis
group: nis [NOTFOUND=continue] files

I just found out a very interesting thing... When I change my shell to tcsh the cd ~omar works fine but the chown command still failles on unknown user
Leonid Mishkind
Frequent Advisor

Re: NIS user problem

and ... cd ~root works fine and all other local users work fine... I checked about 5 nis users ... none of them work....
Dennis Handly
Acclaimed Contributor

Re: NIS user problem

>I am working with user root which has /sbin/sh.

That's a real shell.

>The files are with root permissions since I can't chown to the user.

Sure you can. Just use a hammer:
# chown -R 333:users /aux1/users/omar

>omar:*:333:20:arda omar,55167,,:/users/omar:/bin/tcsh

If you have a "*", how can you log in without using su(1)?

>When I change my shell to tcsh

Probably because that isn't a real shell. :-)
Steven Schweda
Honored Contributor

Re: NIS user problem

Ok. The ypcat result makes it appear that
NIS is working, but that it's being ignored.

Is this one of those cases where you need a
+
line at the end of /etc/passwd (and
/etc/group)?

man 4 passwd (And look for NIS.)

Otherwise, I'm running low on ideas.
Robert-Jan Goossens_1
Honored Contributor

Re: NIS user problem

Hi Leonid,

---
and ... cd ~root works fine and all other local users work fine... I checked about 5 nis users ... none of them work....
---

I've got a feeling your shell is missing a step, nis gets its information from your nis master server

omar:*:333:20:arda omar,55167,,:/users/omar:/bin/tcsh

On you local server you have
/users/omar but that is linked to a NAS filesystem.If you use $HOME (ksh) or ~home (csh) you shell expects the directory to be mounted, you shell does not do a change directory!

I think you can solve this by either using the automounter and link the user to a nfs mounted filesystem or adding the info of the local homedir to the passwd file.

example
+omar:::::/aux1/users/omar:
get all info from the NIS master/slave except the info of the homedir.

Hope this helps,
Robert-Jan
Steven Schweda
Honored Contributor

Re: NIS user problem

Has this stuff ever worked in the past, or is
this a new installation/configuration?

HP-UX version?
Leonid Mishkind
Frequent Advisor

Re: NIS user problem

Hi everyone . Sorry for such a late reply , I was sick for a few days.
Robert â What do you mean when you say shell is missing a step?
The home dir is not a NFS.
I think that compat mode will solve the problem but this is not a good solution for me since I have to much NIS users that use this server.
Steven â I cant say if this worked before or not but this is not a new installation. It is HPUX 11.11 and I do have a + at the end of passwd .
Dennis â what does it mean real shell and not real shell?

To everyone , I think it might be a patch problem ( I dont have a patch management policie on the server ) . Any suggestions in what to look in the patch description?

Thanks to every one,
Leonid.
Dennis Handly
Acclaimed Contributor

Re: NIS user problem

>what does it mean real shell and not real shell?

This was in answer to Steven's "you aren't using some obsolete shell which ...?"

Either ksh or the Posix shell sh. The later, /sbin/sh, must be the shell for root.
The opposite of a real shell is the scummy csh.
Leonid Mishkind
Frequent Advisor

Re: NIS user problem

Hi I decide to open a case in HP. Thanks for all the replies.
Leonid Mishkind
Frequent Advisor

Re: NIS user problem

Hi everyone.
Installing PHNE_36168 solved the problem

Leonid.