I am running Debian 5.03. 2.6.18. When I run ps aux to look at running processes, some of them show the uid of the user, and others show the actual username. However if I run top, it shows the correct username, not their uid. Why is this happening, and should I be concerned?

1001      1877  0.0  0.7  16492  1924 ?        S    12:14   0:00 /usr/bin/php-cgi
1001      1878  0.0  0.7  16492  1924 ?        S    12:14   0:00 /usr/bin/php-cgi
1001      1879  0.0  0.7  16492  1924 ?        S    12:14   0:00 /usr/bin/php-cgi
1001      1880  0.0  0.7  16492  1924 ?        S    12:14   0:00 /usr/bin/php-cgi
1001      1881  0.0  0.7  16492  1924 ?        S    12:14   0:00 /usr/bin/php-cgi
rv        1890  0.0  1.8  16492  4964 ?        Ss   12:14   0:00 /usr/bin/php-cgi
rv        1891  0.0  1.5  16776  4168 ?        S    12:14   0:00 /usr/bin/php-cgi
rv        1892  0.0  1.5  16780  4172 ?        S    12:14   0:00 /usr/bin/php-cgi
rv        1893  0.0  1.5  16780  4172 ?        S    12:14   0:00 /usr/bin/php-cgi
rv        1894  0.0  1.5  16780  4172 ?        S    12:14   0:00 /usr/bin/php-cgi

I notice all my RHEL boxes show UIDs for an account, and it's the same on all of them. (haldaemon) Probably due to how long the name is? It's the only one I see that's longer than eight characters. Are the accounts you've shown longer than that?

Some googling for just that seems to indicate that's the issue: http://www.linuxquestions.org/questions/linux-newbie-8/ps-aux-displays-users-as-uids-instead-of-username-645456/

--Christopher Karel

  • 1
    I believe you are correct. All of the usernames which are showing the uid are longer than eight characters. – muncherelli Aug 16 '10 at 17:59
  • Newer versions of the ps command don't have this problem. Using procps-ng 3.3.10, the ps command prints verylongname as verylon+. – Keith Thompson Jun 10 '15 at 0:30

I doubt that this is your problem, but I include it for completeness. You can override the width of the field and if it's shorter than your usernames, it will automatically switch to showing UIDs.

For example:

ps x o user:4,pid,cmd

Typically, when a numeric UID is displaying in a situation like this, it indicates that there may no longer be an entry in /etc/passwd for the UID. Is 1001 specified in /etc/passwd?

  • Yes. They are in /etc/passwd. – muncherelli Aug 16 '10 at 18:00

This probably means there's a problem with the password name service...

Is rv and 1001 the same user, or is rv a different user?

Are you using NIS? LDAP? What does grep passwd /etc/nsswitch.conf say you're using? What does grep :1001: /etc/passwd say?

If you are running NIS or LDAP and having these sorts of problems, you may want to install nscd and investigate performance issues on the NIS/LDAP/whatever servers...

It's also possible that you have stuff running as a userid that doesn't exist on the system anymore. Is this apache with suexec configured such that the PHP scripts run as the user who owns them? Or some similar mechanism? (suexec should be checking that 1001 is a valid user on the system first)

  • The processes are fastcgi php processes running under lighttpd. – muncherelli Aug 16 '10 at 18:01

I can confirm Christopher Karel is right: I have the same situation on a CentOS5 machine. Besides that, also Dennis Williamson is right on pointing out that the lenght of the user field displayed by the command ps is related to this. Since user field is 8 characters wide by default, any username longer will be shown as a numeric UID... So no concerns at all: just set a wider default if you like to see full names there, or pass it as an option when you run the ps command.. Just my 2c =)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.