Side-by-side comparison of EACCES and EPERM — understand the differences, causes, and fixes.
The requested access to a file or resource is not allowed by the file permissions.
The file permission bits do not grant the requested access (read, write, or execute) to the calling user. This differs from EPERM in that it specifically relates to filesystem permission checks rather than capability checks.
Check file permissions with ls -la. Modify permissions using chmod. Verify directory execute permissions on all path components. Change ownership with chown if appropriate.
The process does not have the required permissions to perform the requested operation.
The calling process lacks the necessary privilege for the system call. This typically occurs when a non-root process attempts an operation reserved for the superuser, such as modifying system files or changing process ownership.
Run the command with elevated privileges using sudo. If the operation involves file ownership, use chown as root. Verify that the process has the correct capabilities assigned via setcap if running without full root access.