0

I am trying to remove a directory and it fails:

[root@pmds-n48 autoit]# rm -rf /home/pick/.gvfs
rm: cannot remove '/home/pick/.gvfs': Is a directory

When I checked the permission, it has all ?

d??????????  ? ?    ?             ?            ? .gvfs

selinux has been disabled and there are no errors in the logs.

  • 5
    Is this a fuse/sshfs or a samba share? Can you share code how you connect/bind/mount? – Z0OM Feb 05 '23 at 07:39

1 Answers1

0

The question marks in the file information indicate that you have no permissions to run a stat() system call on the directory. Most often, it means you have only r but not x permission to the directory the target is in, i.e. /home/pick. See ls -ld /home/pick to verify.

Also note that if /home is a NFS share mounted from another server, the server computer can restrict the root of the NFS client computer to be the equivalent of nobody when accessing the share. This is done at the NFS server side, often by default, and overcoming it may require a no_root_squash export option for the share at the NFS server.

Making the root of the NFS client powerless on a NFS share is a security mechanism that prevents someone that has managed to gain illegitimate root access to the NFS client from easily getting root in the NFS server too.

telcoM
  • 96,466