ps displays uid number instead of name

Herta Van den Eynde herta.vandeneynde at gmail.com
Mon Aug 6 23:25:34 UTC 2007


On 06/08/07, Richard Riley <rriley at procuri.com> wrote:
> I have just noticed on a couple of my RHEL 4 servers that when I run the
> "ps" command it displays the uid number instead of the userid name for
> some users.  I have these same users on other RHEL 4 servers (same
> version) and everything is displayed normally.  The user names that I
> have problems with are all over eight characters long.
> This is not a big problem, but it is annoying to have to lookup the uid
> number in the password file to determine the user associated with the
> process.
>
> Richard Riley
> System Administrator
> Procuri Inc.
> www.procuri.com
>
I don't know of a solution, but perhaps a workaround will do for you.
Use 'vipw' to edit /etc/passwd and /etc/shadow.  Duplicate the lines
with the long usernames, and change the username closest to the top to
a shorter one.  E.g.

lun:x:700:700::/home/longusername:/bin/bash
longusername:x:700:700::/home/longusername:/bin/bash

if you don't want anyone to log in using the short username, simply
comment out the password in /etc/password:

lun:!!:13731:0:99999:7:::
longusername:$1$gUIEQ8UG$W/LDkMhA1z9UmNbRv95Fg.:13731:0:99999:7:::

Hope this helps.

Kind regards,

Herta




More information about the redhat-sysadmin-list mailing list