Weird permissions after sudo chmod

On Ubuntu 20.10. When I run something like:

sudo chmod -R +766 /etc/apache2

I end up with permissions that do not allow my user (in group "other") to access the files in /etc/apache2. When I look at the permissions in nautilus, they say something something "no access".

How do I fix this???

1

1 Answer

In Linux (and other POSIX-like operating systems), the execute bit has a special meaning for directories: it means that the given user or group can access the inodes of the files inside the directory. So chmod g+r on a directory means that group members can list the files, but they can't know anything about them, and chmod g+rx is needed to actually read the files inside.

You probably should be doing chmod -R +755, not 766.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like