netscrew.dev/commands/share
Command

n share

Share (export) a local folder over SMB — the recipe for your OS

Short forms:export · serve

Usage — n share

═══════════════════════════════════════════════════════════════════════════════
  Netscrew ("n") — share (export, serve) — Share (export) a local folder over SMB — the recipe for your OS
═══════════════════════════════════════════════════════════════════════════════

USAGE:
  n share .                            list what this machine is already sharing
  n share <folder> [user]              recipe to share a folder read-write
  n share <folder> [user] --ro         read-only
  n share <folder> --name <n>          set the share name (default: folder name)

OPTIONS:
  --rw / --ro                      read-write (default) or read-only
  --name <n>                       share name · --user <u> who may connect

Target: . = this machine · <host> = remote
Deeper: n share -h = the concept/theory behind this command  ·  n -h ntfs-acls  ·  n mount  (the reverse)

The concept behind it — n share -h

═══════════════════════════════════════════════════════════════════════════════
  NETSCREW PLAYBOOK: Share Permissions vs. NTFS Permissions ["ntfs-acls"]
═══════════════════════════════════════════════════════════════════════════════

THE INTERSECTION RULE:
  Every Windows share has TWO distinct security layers:
  1. Share Permissions (SMB Network Gate): e.g. "Everyone: Full Control"
  2. NTFS Permissions (Disk ACLs): e.g. "Users: Read & Execute"

  Windows enforces: Effective Permission = Share ACL ∩ NTFS ACL (Most Restrictive Wins!)
  If the share grants Full Control, but the disk folder only allows Read,
  remote users CANNOT write or save files!

BEST PRACTICE ARCHITECTURE:
  • Set Share Permissions to "Authenticated Users: Change / Read".
  • Control all security restrictions strictly through NTFS Directory ACLs.

REMEDIATION WITH ICACLS (PowerShell / CMD):
  icacls "D:\ShareFolder" /grant "Authenticated Users":(OI)(CI)M /T

  Flags:
  • (OI) Object Inherit: Files inherit permissions
  • (CI) Container Inherit: Subdirectories inherit permissions
  • M    Modify: Read, write, modify, delete
  • /T    Traverse: Apply recursively to all child items