![Apache - 为什么我的 Apache 用户是一个数字?](https://linux22.com/image/585876/Apache%20-%20%E4%B8%BA%E4%BB%80%E4%B9%88%E6%88%91%E7%9A%84%20Apache%20%E7%94%A8%E6%88%B7%E6%98%AF%E4%B8%80%E4%B8%AA%E6%95%B0%E5%AD%97%EF%BC%9F.png)
$ ps aux | grep httpd
1003 22806 0.0 0.3 17624 7684 ? S May25 0:00 /opt/web/apache/bin/httpd -k start
1003 4834 0.0 0.3 17624 7684 ? S May28 0:00 /opt/web/apache/bin/httpd -k start
1003 5299 0.0 0.3 17740 7804 ? S May28 0:00 /opt/web/apache/bin/httpd -k start
1003 5503 0.0 0.3 17624 7684 ? S May28 0:00 /opt/web/apache/bin/httpd -k start
1003 5875 0.0 0.3 17624 7684 ? S May28 0:00 /opt/web/apache/bin/httpd -k start
1003 5970 0.0 0.3 17624 7684 ? S May28 0:00 /opt/web/apache/bin/httpd -k start
1003 6062 0.0 0.3 17624 7672 ? S May28 0:00 /opt/web/apache/bin/httpd -k start
1003 6245 0.0 0.3 17624 7684 ? S May28 0:00 /opt/web/apache/bin/httpd -k start
1003 6338 0.0 0.3 17624 7672 ? S May28 0:00 /opt/web/apache/bin/httpd -k start
1003 24091 0.0 0.3 17624 7764 ? S May30 0:00 /opt/web/apache/bin/httpd -k start
我的 apache 用户好像是 1003,不是吗?
答案1
ps
如果用户名超过一定数量的字符(在您的情况下可能超过 7 或 8 个字符),则使用 UID 号码。
从手册页中,
euser EUSER effective user name. This will be the textual
user ID, if it can be obtained and the field width
permits, or a decimal representation otherwise. The n option
can be used to force the decimal representation.
(alias uname, user).
因此,根据用户名列输出的宽度,您的用户名可能太长。
用来grep ":1003:" /etc/passwd
查看用户名并了解其长度。