USER keep change to IN_501 and group to nagios

General support questions
Post Reply
JenniferLiu
Posts: 6
Joined: 2017/03/24 15:57:30

USER keep change to IN_501 and group to nagios

Post by JenniferLiu » 2017/03/24 16:03:50

Hi,

I installed a new centos6.8 server. I created a user but when login as userid, it sometime show as IN_501 and the group change to nagios. All my script could not work because of wrong userid.

$ id
uid=501(IN_501) gid=501(nagios) groups=501(nagios),488(fuse)

$ env | 501

USER=IN_501
MAIL=/.../IN_501
LOGNAME=IN_501

After a while, it can change back to normal userid by itself. But this happens again randomly after.

Do you have any idea why the user change to IN_501 and how to fix it ?

Thanks a lot
Jennifer

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: USER keep change to IN_501 and group to nagios

Post by TrevorH » 2017/03/24 16:20:46

Sounds like you have another user with the same 501 uid. Try grep 501 /etc/passwd (and repeat for /etc/group. If using non-local authentication (e.g LDAP) then you'd need to check in that authentication source too.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

JenniferLiu
Posts: 6
Joined: 2017/03/24 15:57:30

Re: USER keep change to IN_501 and group to nagios

Post by JenniferLiu » 2017/03/24 16:29:37

Thanks for the help.

I have checked there is only 1 line in /etc/passwd and /etc/group which is the correct userid with 501.

I am not sure how to check the authentication part you mentioned ?

JenniferLiu
Posts: 6
Joined: 2017/03/24 15:57:30

Re: USER keep change to IN_501 and group to nagios

Post by JenniferLiu » 2017/03/24 16:39:39

here is the file in my server :

# grep 501 /etc/group
myuserid:x:501:myuserid

# grep 501 /etc/passwd
myuserid:x:501:501:myuserid:/home/myuserid:/bin/bash

# ls /etc/ldap.conf
ls: cannot access /etc/ldap.conf: No such file or directory
Last edited by JenniferLiu on 2017/03/24 18:35:13, edited 1 time in total.

JenniferLiu
Posts: 6
Joined: 2017/03/24 15:57:30

Re: USER keep change to IN_501 and group to nagios

Post by JenniferLiu » 2017/03/24 16:41:52

Here is from my server with ldap :

# grep 501 /etc/group
myuserid:x:501:myuserid

# grep 501 /etc/passwd
myuserid:x:501:501:myuserid:/home/myuserid:/bin/bash

ls /etc/ldap.conf
ls: cannot access /etc/ldap.conf: No such file or directory

# chkconfig --list | grep ldpa
lldpad 0:off 1:off 2:off 3:off 4:on 5:off 6:off

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: USER keep change to IN_501 and group to nagios

Post by TrevorH » 2017/03/24 18:57:51

Well the problem would be that in CentOS 6, all uids over 500 are meant for normal users and all users < 500 are meant to be "system" ones. Your nagios user should probably have a uid < 500 to make it fit with this scheme. In CentOS 7 it's changed to be 1000 not 500.

You can also try getent passwd IN_501 to find the user by name (or getent passwd 501 as well).

Also, doesn't really help with this, but if you are just starting out with nagios, you might want to check out icinga2 instead. That started life as a fork of nagios but has evolved nicely into a much better package now. It scales better, uses less resources and is easier to set up.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

JenniferLiu
Posts: 6
Joined: 2017/03/24 15:57:30

Re: USER keep change to IN_501 and group to nagios

Post by JenniferLiu » 2017/03/24 19:39:38

Thank you very much.

The getenv command got this output. Is this Ted tanaka a user ? But I have not defined such a user ?
Is there a way to get rid of this one to avoid the IN_501 issue ?

Thanks a lot

# getent passwd IN_501
IN_501:*:501:29:(ted) Ted Tanaka,inactive:/usr/vivid/ted:/bin/false

# getent passwd 501
IN_501:*:501:29:(ted) Ted Tanaka,inactive:/usr/vivid/ted:/bin/false

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: USER keep change to IN_501 and group to nagios

Post by TrevorH » 2017/03/24 21:49:31

No, that's coming from your system somewhere. Check what your system is set to use in /etc/nsswitch.conf for passwd and group entries then check those directories for the user in question.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

JenniferLiu
Posts: 6
Joined: 2017/03/24 15:57:30

Re: USER keep change to IN_501 and group to nagios

Post by JenniferLiu » 2017/03/28 20:26:56

Thank you for the help. The /etc/nsswitch.conf had following items:

# cat /etc/nsswitch.conf | grep passwd
#passwd: db files nisplus nis
passwd: files

# cat /etc/nsswitch.conf | grep group
#group: db files nisplus nis
group: files
netgroup: nisplus

The netgroup show netgroup : nisplus. Some other servers have netgroup: files.

Maybe that is the cause ?

Post Reply