Why user becomes nobody?
9,328
Another possible explanation is that you run this stuff on a filesystem which is fixed to one user.
Cases for this could be ntfs
or vfat
.
A nfs
mount with root_squash
(the default) might be another reason.
Related videos on Youtube
Author by
Rosser
Updated on September 18, 2022Comments
-
Rosser over 1 year
I have a problem about linux user, I use a command to add user like:
useradd -u 532 -d /data/test01 -g test test01
but when I login as
test01
and runmkdir x
, it becomes like:nobody test x
Why user becomes
nobody
? How do I fix it ?-
11684 about 11 yearsPerhaps better at Ask Ubuntu?
-
Denys Séguret about 11 yearsor superuser if it's not ubuntu. [note to admin : those 2 comments predate the migration and could be deleted]
-
Huygens about 11 yearsCould you provide the output of
grep 532 /etc/passwd
? -
Rosser about 11 yearstest01:x:532:528::/data/test01:/bin/bash
-
Huygens about 11 yearsIf you do
ls -ldn x
do you get532 528 x
for your directory ownership? And what aboutgrep nobody /etc/passwd
? -
Rosser about 11 yearsyeah,the file owner uid is 99 not 532 , but I use chown test01:test x , it would be nobody again , so I don't know how to fix it.
-
Rosser about 11 yearsnobody:x:99:99:Nobody:/:/sbin/nologin
-
Huygens about 11 yearsWhat are the complete permissions of the parent directory of
x
? -
Rosser about 11 yearsdrwxr-xr-x. 2 nobody test 6 Mar 13 17:04 x
-
Rosser about 11 yearsby the way , my server is using nfs , but I add user at all server by same uid everytime.
-
Huygens about 11 yearsTry doing:
touch /tmp/test01; ls -l /tmp/test01
is the output is correct then see @glglgl answer, it is more than probably your NFS configuration on this box that should be investigated. -
Rosser about 11 yearsMy nfs server is OK , it doesn't have nobody problem,But others nfs client has. What can I do?
-
Huygens about 11 years@Rosser OK, I provided you with an alternative explanation + solution in my existing answer.
-
-
Rosser about 11 yearsmy nobody uid is 99 : nobody:x:99:99:Nobody:/:/sbin/nologin
-
Rosser about 11 yearsThank for your explanation + solution , but the /etc/passwd in my NFS server is the same form NFS client , and my NFS server set is like : (rw,no_root_squash,sync), it should use the same uid not nobody...