Linux Commands / IT Support Guides
Read Linux permission bits before changing access
Read Linux file permissions and check the directories that lead to the file.
Environment and inputs: Linux · Bash-compatible shell; package and service names vary by distribution
Understand the problem
Identify the file and the account that needs access. Replace the example paths with the actual directory and file.
Run the command
Use ls -ld to show the parent directories themselves, then stat to inspect the permissions and owner of the file.
ls -ld /srv /srv/app
stat /srv/app/config.ini
Read the output
A mode of 0640 allows the owner to read and write and the group to read. Other users receive no access through those mode bits. In a directory, the execute bit controls whether an account can traverse it.
Choose the next step
Check the account’s groups and walk the full path one directory at a time. If ordinary permissions look correct, check access control lists or service restrictions before changing the file.
Before making changes
Record the original owner, group and mode before any change. Grant only the access the application needs and verify it with that application’s account.