Sub topic 8
NTFS permissions versus share permissions
This chapter assumes you can create Windows users and groups and know what a shared folder is. Windows controls access to files in two layers. NTFS permissions apply to the file system itself. Share permissions apply only when someone reaches a folder over the network. Knowing which layer applies, and how they combine, is a common A+ exam topic.
The two layers
NTFS permissions are stored on files and folders on an NTFS volume. They apply to local users, remote users, and services. Share permissions are set on the shared folder. They apply only to network access, and they work on FAT32 volumes too.
| Feature | NTFS permissions | Share permissions |
|---|---|---|
| Applies to | Local and network access | Network access only |
| Set on | Files and folders | Shared folders only |
| Levels | Full Control, Modify, Read & Execute, List Folder Contents, Read, Write | Full Control, Change, Read |
| Inheritance | Yes, to subfolders and files | Not applicable |
| File system | NTFS only | NTFS or FAT32 |
How the layers combine
When a user connects over the network, Windows checks both layers. The most restrictive result wins. First, add up the permissions the user gets through all their groups within each layer. Then compare the two totals and keep the lower access.
For example, a user is in a group with Full Control at the share level. The same user has only Read from NTFS. The effective access is Read.
An explicit Deny overrides an Allow within a layer. Use Deny sparingly, because it is hard to troubleshoot.
Inheritance and moving files
Folders pass NTFS permissions down to their contents by default. You can break inheritance on a subfolder to set different permissions there. Copying and moving affect permissions differently:
- Copying a file to a new location, even on the same volume, gives it the permissions of the destination folder.
- Moving a file within the same volume keeps its original permissions.
- Moving a file to a different volume gives it the destination permissions, because Windows copies it and deletes the original.
Setting permissions with icacls
The icacls command sets NTFS permissions from the command line. This command gives the Accounting group Modify on the Finance folder. The (OI) flag applies it to files and (CI) applies it to subfolders.
icacls "C:\Finance" /grant "Accounting:(OI)(CI)M"This applies least privilege, because the group gets only the access it needs. Run icacls "C:\Finance" with no other options to review the current permissions.
Administrative shares
Windows creates hidden administrative shares, such as C$ and ADMIN$. A trailing $ hides a share from network browsing. Only administrators can use these shares by default. A common practice is to hide a share by adding $ to its name, but this is not a security control. The permissions still do the real protection.
Common errors
- A user has Full Control in NTFS but cannot write over the network. Check the share permissions, which may be Read.
- A user on the local machine can open a file that network users cannot. Share permissions do not apply to local logons.
- Permissions seem to change after a file move. Check whether the move crossed volumes.
Exercise
A user belongs to two groups. Group A has Change at the share level and Read at the NTFS level on a folder. Group B has Read at the share level and Modify at the NTFS level. What is the user's effective permission over the network?
Show answer
Modify at NTFS is the NTFS total, and Change at share is the share total, since each layer adds up the permissions from all groups. The most restrictive of the two is Change, which is equivalent to Modify in effect. The user can read, write, and delete files, though not change permissions.
Exercise
You move a file from D:\Reports to E:\Archive. Which permissions does the file have afterward?
Show answer
It takes the permissions of E:\Archive, because moving between volumes copies the file and deletes the original.