If you are using FSx filesystems, particularly in an AWS setting. It's important to know that the default options have root squash enabled. When root_squash is enabled, it prevents the root user from changing file ownership, resulting in the "Operation not permitted" error when trying to chown the license file.
Fortunately it's easy to remediate by going into the AWS control panel and changing the settings on FSX , to disable root squash.
AWS docs handle this here: https://docs.aws.amazon.com/fsx/latest/LustreGuide/root-squash.html#manage-root-squash
Here are the steps, and please see the note in bold at the bottom. (Choose disable, instead of performing steps 4-6)
To update root squash settings on an existing file system (console)
- Open the Amazon FSx console at https://console.aws.amazon.com/fsx/.
- Navigate to File systems, and choose the Lustre file system that you want to manage root squash for.
- For Actions, choose Update root squash. Or, in the Summary panel, choose Update next to the file system's Root Squash field to display the Update Root Squash Settings dialog box.
- For Root Squash, update the user and group IDs with which the root user can access the file system. You can specify any whole number in the range of
0–4294967294. To disable root squash, specify0(zero) for both IDs.
- For User ID, specify the user ID for the root user to use.
- For Group ID, specify the group ID for the root user to use.
- For Exceptions to Root Squash, do the following:
- Choose Add client address.
- In the Client addresses field, specify the IP address of a client to which root squash doesn't apply,
- Repeat as needed to add more client IP addresses.
Choose Update.
NoteIf root squash is enabled and you want to disable it, choose Disable instead of performing steps 4-6.
You can monitor the update progress on the file systems detail page in the Updates tab.