2

I have a soft link that was accidentally moved as a result of a user drag/drop operation in a Filezilla UI. Is there a way to prevent a user from moving the link but leaving all other permissions intact?

Update:

To solve this problem we changed the owner of the link to the root user.

3

No, there is not.

If the user has permissions to write the directory that contains the symlink, then they will be able to do the following things:

  • Remove all kinds of files from that directory
  • Create all kinds of files in that directory
  • Rename files within that directory
  • Move files into the directory (assuming they also have write permission on the directory the file comes from).
  • Move files out of the directory (assuming they also have write permission on the directory the file is going to).

Perhaps you can use the sticky bit to achieve what you want? The sticky bit restricts operations on files within the directory to the owner of the file involved. So then the user would only be able to move or remove the symlink if they were the owner of the symlink. Be aware that the sticky bit is global per directory, so its effect will not be restricted by user nor by file type (symlink or otherwise).

chmod +t directory  # set sticky bit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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