Reputation: 31548
I have currently this permission in my / folder.
drwxr-xr-x
. I have seen that anyone can open that folder.
How can remove the executable permission from that so that other permission remain same Also is any other main folder in / where i need to remove public executable permission
Upvotes: 0
Views: 7304
Reputation: 81
To change all the folders & sub-folders (directories) permission to 755 inside the directory /path/to/directory
, use the below command.
find /path/to/directory -type d -exec chmod 755 {} \;
To change all the file permissions to 644 inside the directory /path/to/directory
find /path/to/directory -type f -exec chmod 644 {} \;
0: no permission,
1: execute
2: write
3: write and execute
4: read
5: read and execute
6: read and write
7: read, write, and execute
Upvotes: 1
Reputation: 143017
chmod a-x /
will remove/subtract the ex
ecute permission for all ('a'
) from folder /
-- is there a particular reason for wanting to do this?
See the "symbolic Mode" on this chmod man page for more information.
Upvotes: 2
Reputation: 182609
By removing executable permission in /
you'll make anything under it inaccessible. You can do it with chmod -x /
but it's highly inadvisable.
For most practical purposes this will make everything inaccessible to regular users. Even worse, this will likely prevent ssh connections to the box so even with root you'll need physical access to a tty.
Upvotes: 4