Why doesn't "getent passwd username" command show user's information if username is ALL numeric?

Solution Verified - Updated -

Issue

  • Why doesn't getent passwd username command show user's information if username is ALL numeric?

  • There are some numeric usernames in NIS server, on NIS client, 'getent passwd username' command doesn't work for ALL numeric usernames:

[root@rhel ~]# id 12345
uid=67890(12345) gid=10(wheel) groups=10(wheel)

[root@rhel ~]# ypcat passwd | grep 12345
12345:x:67890:10:Test Numeric User:/:/bin/bash

[root@rhel ~]# getent passwd | grep 12345
12345:x:67890:10:Test Numeric User:/:/bin/bash

[root@rhel ~]# getent passwd 12345         <---- Doesn't return any info
[root@rhel ~]# getent passwd -s nis 12345
[root@rhel ~]# echo $?
2

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • shadow-utils

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content