Applicable Products
Scenario
When you move a file between folders on your NAS, the file retains its original permissions and does not inherit the permissions of the destination folder.
Solution
Samba handles file moves in this way by design. To avoid permission inheritance issues, we recommend using copy/paste instead of cut/paste when moving files.
Details
File operations (copy, cut, paste) in Samba have different permission inheritance rules depending on the operation and whether the files are moved within the same or across different volumes. The table below summarizes the variations.
| Operation | Scenario | System Behavior | Permission Inheritance |
|---|
| Copy/Paste | - Within the same volume, share, or folder
- Across different volumes, shares, or folders
| The system treats the copied file as a newly created file. | The copied file inherits the destination folder's permissions. |
| Cut/Paste | - Within the same volume, share, or folder
| The file is simply moved; no new copy is created. | The moved file retains its original permissions and does not inherit the destination folder's permissions. |
- Across different volumes, shares, or folders
| The system treats the file as a newly created file, but retains all explicit permisisons. | The moved file maintains its original explicit permissions and does not inherit destination folder's permissions. |
Further Reading
How can I configure NAS shared folder permissions in Windows?
适用产品
场景
当您在 NAS 上移动文件夹之间的文件时,文件保留其原始权限,并不会继承目标文件夹的权限。
解决方案
SAMBA 设计上就是这样处理文件移动的。为避免权限继承问题,我们建议在移动文件时使用复制 / 粘贴而不是剪切 / 粘贴。
详细信息
SAMBA 中的文件操作(复制、剪切、粘贴)根据操作类型以及文件是在同一卷内还是跨不同卷移动,具有不同的权限继承规则。下表总结了这些差异。
| 操作 | 场景 | 系统行为 | 权限继承 |
|---|
| 复制 / 粘贴 | | 系统将复制的文件视为新创建的文件。 | 复制的文件继承目标文件夹的权限。 |
| 剪切 / 粘贴 | | 文件只是被移动,没有创建新的副本。 | 移动的文件保留其原始权限,并不会继承目标文件夹的权限。 |
| 系统将文件视为新创建的文件,但保留所有显式权限。 | 移动的文件保持其原始显式权限,并不会继承目标文件夹的权限。 |
进一步阅读
如何在 Windows 中配置 NAS 共享文件夹权限?