chmod is used to change the commonly used read, write, and execute permissions on files. It can change these permission bits for the file owner, the file's group owner, and everyone else. It can also change the more esoteric ‘permissions’ (attributes, reall) like set-user-ID, set-group-ID, and ...

learn more… | top users | synonyms

13
votes
3answers
2k views

I accidentally chmod -R +x on a directory. How do I restore the correct permissions?

Well, to be specific, it was chmod -R 755. Now every file is executable, which I don't want. I am thinking that I should look at the first two bytes of each file for the #!, but will this cover ...
12
votes
3answers
3k views

Wrongly set chmod / 777. Problems?

I was trying to run chmod -R 777 ./ but ended up typing chmod -R 777 / and set 777 on my entire machine. What can go wrong? How can I fix it?
27
votes
4answers
3k views

How to recover from a chmod -R 000 /bin?

And now I am unable to chmod it back.. or use any of my other system programs. Luckily this is on a VM I've been toying with, but is there any way to resolve this? The system is Ubuntu Server 12.10. ...
15
votes
2answers
2k views

How to apply recursively chmod directories without affecting files?

After I apply chmod -R to a directory, permissions are changed for everything within (files and directories). How can I add execute/search (x) permissions to directories without modifying the files?
3
votes
2answers
298 views

Chmod by Letters Vs Numbers

I was recently asked by a colleague to use chmod with letters instead of numbers. Apart from the obvious readability advantage is there any particular reason to use letters over numbers ?
8
votes
2answers
21k views

Recursive chmod only folders or only files via script or nautilus menu?

This has been discussed before here. What I'd like to know is how to turn these: Recursive chmod only files within this folder: find . -type f -exec chmod 0600 {} \; Recursive chmod only folders ...
2
votes
7answers
1k views

Convert ls -l output format to chmod format

Say I have the following output from ls -l: drwxr-xr-x 2 root root 4096 Apr 7 17:21 foo How can I automatically convert this to the format used by chmod? For example: $ echo drwxr-xr-x | ...
5
votes
3answers
438 views

Unix users, groups, and permissions

I don't understand unix users, groups, permissions, etc. For example, things managed by the chmod, chgrp, usermod, groupadd, etc. commands. How do all these things work?
2
votes
3answers
160 views

User with read access to /home

Pardon my ignorance but I can't seem to come up with a solution to this one. I'd like to create a user that has read access to every user's home catalog located in /home. Do I need acl's for this or ...
2
votes
1answer
699 views

No effect of umask and chmod on mounted drives

The windows drives are mounted at boot-time using pysdm. The setting were nls=iso8859-1,users,umask=002,sync,user,dirsync,uid=mtk When I try to change the permission of files using chmod, I don't ...
92
votes
6answers
5k views

How to chmod without /usr/bin/chmod?

Today I was told a tale by a Unix trainer, a tale where the root password got leaked to the students, and one of the fellas removed the execute permission from /usr/bin/chmod itself. How do you ...
2
votes
1answer
194 views

chmod -R 644 ~/Documents

I recently noticed that all of the files in my ~/Documents were somehow incorrectly given executable status. This proved annoying as trying to opening any file gave me a message box saying it was ...
5
votes
2answers
241 views

Is it possible to represent the +X symbolic permission with an octal value?

Is it possible to represent the +X symbolic permission with an octal value? The chmod(1) man page says: execute/search only if the file is a directory or already has execute permission for some ...
5
votes
2answers
1k views

recursively change file permission but not directories?

I was doing a mass recursive change of permissions of some files that I had migrated to a unix system. I changed them to ug+rw, but then I found that I could not traverse subdirectories. I looked at ...
2
votes
2answers
4k views

Find web server group? Permissions problem

I'm trying to make Wordpress work. I currently have this error message: Could not create directory. /var/www/html/wp-content/upgrade/theme_name when trying to upload a theme. This is the ...
1
vote
3answers
73 views

Reverse a chmod command on a directory

Is there a way to undo a chmod command on a directory in CentOS ?