Running processes. Why displayed uid number instead username?

Anton Shevtsov picture Anton Shevtsov · Sep 16, 2011 · Viewed 27.2k times · Source

ps -eaf

..

kude     22593 12078  0 09:06 ?        00:00:02 smbd -D
hasi     22929 12078  0 09:12 ?        00:00:00 someprog.pl
root     22950    43  0 Sep08 ?        00:00:19 [nfsiod]
root     24558    43  0 Sep09 ?        00:00:28 [pdflush]
root     25320     1  0 00:00 ?        00:00:01 /usr/bin/atop -a -w /var/log/atop/atop_20110916 600
1466     25757 12078  0 10:12 ?        00:00:00 smbd -D
root     26752 12078  0 10:32 ?        00:00:01 smbd -D

..

id username2

uid=1466(username2) gid=513(DomainUsers) groups=513(DomainUsers)

All users in LDAP (/etc/nsswitch.conf is correct, all is correct - but only this user do not show)

Why displayed uid number (1466) instead username?

Answer

Ray Toal picture Ray Toal · Sep 16, 2011

There is an 8-character limit for usernames to be listed in ps -ef (POSIX) or ps aux (BSD-derivatives). Explanation of options

I've searched man pages on both Macs and Linux boxes and did not see that limit recorded there.

The question does routinely appear on forums with the 8-character limit as the answer.

I did finally stumble upon this page in which the "bug" was reported against Debian but closed as being not a bug. They reference this page which also makes a claim about how POSIX and UNIX standards require falling back to uids when names are too long. Also not from the actual POSIX standard.

I don't know if this is authoritative, but it does explain the behavior you are seeing with a 9-character username. :)

Maybe someone else can post an answer to a more authoritative link?