# error: open /etc/shadow: permission denied

- **ID:** `go/os-file-permission-denied`
- **Domain:** go
- **Category:** auth_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The process does not have the necessary file system permissions to open the file, often due to running as a non-root user.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.20 | active | — | — |
| 1.21 | active | — | — |

## Workarounds

1. **Check permissions before opening and use appropriate user or sudo** (85% success)
   ```
   if os.Geteuid() != 0 { return errors.New("must run as root") }
f, err := os.Open("/etc/shadow")
   ```

## Dead Ends

- **Running entire application as root** — Security risk; better to use capabilities or proper user. (30% fail)
