https://github.com/paralevel/useful-disk-access-for-terminal
Modify protected files in macOS Terminal without having Full Disk Access
https://github.com/paralevel/useful-disk-access-for-terminal
bypass containers defaults finder full-disk-access macos restricted-access sandbox terminal
Last synced: 1 day ago
JSON representation
Modify protected files in macOS Terminal without having Full Disk Access
- Host: GitHub
- URL: https://github.com/paralevel/useful-disk-access-for-terminal
- Owner: paralevel
- License: mit
- Created: 2026-04-16T08:07:51.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-10T15:40:11.000Z (about 1 month ago)
- Last Synced: 2026-05-10T17:27:05.567Z (about 1 month ago)
- Topics: bypass, containers, defaults, finder, full-disk-access, macos, restricted-access, sandbox, terminal
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Useful Disk Access for Terminal
If you for example get a `Could not write domain` error when using the `defaults` command or `Operation not permitted` when trying to access specific files or folders (related to file system areas that are sandboxed or under some kind of protection, instead of file permissions which would give a `permission denied` error), this is usually solved by giving Full Disk Access permission to Terminal ([see here](https://github.com/mathiasbynens/dotfiles/issues/820)), but if you want to avoid doing that just for a single file, you can instead use the following trick (the example is after a failed attempt at running `defaults write -app safari WBSNewTabPositionPreferenceKey -int 0`):
Open ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/ in Finder (e.g. using `open ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/`)
Copy the file 'com.apple.Safari.plist' and paste it into Terminal (press Ctrl-C to abort afterwards) – also has the same effect if you copy the parent folder or one of the other files in the same folder
Retry the `defaults` command
Seems to have a permanent effect and also makes all other files and subdirectories in the same directory accessible, and unlike Full Disk Access which goes into effect for all users, it only affects the current user
Apparently, the behavior [is by design](https://mysk.blog/2026/05/19/cve-2026-28910/#drag--drop-an-intentional-sandbox-loophole) and not a security flaw