How can I disallow a user from moving/renaming a subdirectory of this home directory?
Even if a user doesn't have any rights on a directory, it can rename/move it as long as the source and destination parent directory are writable.
I had a similar problem on macosx. Users inadvertently drag&drop the "Library" folder somewhere else breaking everything as there are applications depending on that path.
I don't it would be better to depend on another path, outside the home dir, or use ".files" but I have a legacy situation.
I tried to fix the problem my putting the dir somewhere else and then making a "bind" mount
mount -o bind sourcepath /home/user/somedir
It prevents the renaming of the dir:
mv: cannot move `somedir' to `somethingelse': Device or resource busy
Does anybody know an easier way?
Easiest is probably using
chattr
: