Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Eucalyptus installed on my Linux machine, and I've noticed that for processes owned by the eucalyptus user, ps reports the userid instead of the username. For example:

$ sudo -i -u eucalyptus
$ ps u
107      29764  0.0  0.0  19376  2104 pts/2    S    11:43   0:00 -bash
107      30198  0.0  0.0  15256  1180 pts/2    R+   11:44   0:00 ps u

What would cause this to happen?

Note that there's a proper entry in /etc/passwd:

$ grep eucalyptus /etc/passwd

Also note that ls property reports the ownership of files by the eucalyptus account:

$ touch foo
$ ls -l foo
-rw-r--r-- 1 eucalyptus eucalyptus 0 2010-09-23 11:47 foo
share|improve this question
up vote 24 down vote accepted

ps uses the uid when the username is longer than 8 characters.

share|improve this answer
Good call. From the man page: "This will be the textual user ID, if it can be obtained and the field width permits, or a decimal representation otherwise." – Michael Mrozek Sep 23 '10 at 19:16
Or perhaps there is no way to translate UID to name. – vonbrand Jan 23 '13 at 15:52

You can control the width of columns:

ps o user:12,pid,%cpu,%mem,vsz,rss,tty,stat,start,time,comm

this reproduces the u format of ps u, but it makes the user field 12 characters wide.

share|improve this answer

Sure you have a problem with your /etc/passwd... you edited it manually, didn't you? :)

anyway, I reproduced the problem copying the line of the user in /etc/passwd and changing the user name by the user id.

Like this:

root@juice:/etc/# grep 129 /etc/passwd
129:x:129:137:Puppet configuration management daemon,,,:/var/lib/puppet:/bin/false
puppet:x:129:137:Puppet configuration management daemon,,,:/var/lib/puppet:/bin/false

Note that the "numbered user" is the first.

root@juice:/etc/# sudo -u puppet -s
129@juice:/etc/$ whoami

129@juice:/etc/$ touch /tmp/a
129@juice:/etc/$ ls -l /tmp/a
-rw-r--r-- 1 129 puppet 0 2010-09-23 19:12 /tmp/a

129@juice:/etc/$ ps u
129      12443  2.2  0.1   7112  4380 pts/1    S    19:12   0:00 /bin/bash
129      12490  0.0  0.0   2716  1068 pts/1    R+   19:12   0:00 ps u

Try to execute "whoami", sure it returns 107 :)

It is a strange behaviour, ps returns the number and ls the normal name :-m...

To solve it:

  • just edit /etc/passwd and delete the incorrect entry
  • or use 'userdel 107', but all programs from eucalyptus must be stoped
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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