-1

I have a dual boot with ubuntu 22.04.2 on one disk and windows 10 on another. The disk with windows is under the user 'lucas', but this provides no security whatsoever for any files in the windows disk as long as I'm logged in to my account. For most files that's fine, but I wanted to either add a custom password or require the user password to enter the folder 'db', or change the owner of the folder 'db' to the user 'test'.

I tried sudo chown test:test 'Hydrus Network', and it doesn't change the owners (ls -l shows all files of the windows disk are still under 'lucas') nor raise an error.

I saw some answers to similar questions talking about mounting, but I'm not sure if they are the answer to my question, and I'm not sure what mounting and unmounting are.

Note: This is my first week using Ubuntu, so give a detailed explanation.

1 Answers1

3

If the "other disk" is Windows, then it's NTFS. NTFS does not respect Linux file permissions. As such, chown, chmod, etc. does not work on NTFS drives and partitions or any files on them.

The only way to set permissions or ownership of files is partition-wide at the time that you mount (open for readability) the partition. If you are simply opening the drive in your GUI file browser, this will default to your own user. You would have to set the ownership independently by manually using mount on the command line to define where to mount the drive partition and what options such as user/group ownership, permissions mask, etc. need to be on the drive. There are numerous example questions such as the one linked to by sudodus in comments on the question which explain how to mount NTFS partitions with the proper usermasks for custom use cases, however be advised this only works partition wide and you can't mount the same drive twice, so if you intend to have a subdirectory on the drive be 'special case' that should live only on the Linux partition and not the Windows partition because of the rules of NTFS and it not supporting Linux/UNIX style permissions.

Thomas Ward
  • 74,764