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

14
votes
3answers
4k 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?
14
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 ...
2
votes
7answers
3k 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 | ...
28
votes
4answers
4k 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. ...
16
votes
2answers
3k 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
469 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 ?
101
votes
6answers
6k 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 ...
8
votes
3answers
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 ...
5
votes
3answers
462 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
161 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
839 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 ...
7
votes
2answers
673 views

How are file permissions calculated?

Using chmod I could set the permissions for a file, but if the parent ( .. ) directory had conflicting permissions, what would happen? And if I create a new file, using touch or something similiar, ...
18
votes
1answer
278 views

Why does chmod require disk space? Not-in-place algorithm?

I try to chmod some files and I get the error "disk quota exceeded": It's true that I don't have that much space remaining in the filesystem where I use chmod, ...
2
votes
1answer
223 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 ...
1
vote
1answer
891 views

Safe to change owner of OS X system folders?

I'm trying to get Homebrew to work. That program's diagnosis tool gives me these suggestions: You should probably chown /usr/local/etc ... You should probably chown them: ...
6
votes
2answers
2k 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 ...
5
votes
2answers
282 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 ...
2
votes
1answer
253 views

What does it mean if a directory has only x (executable) permission for certain user/group?

I stumbled across the directory /etc/ssl/private on Ubuntu (12.04), it has following permission: drwx--x--- 2 root ssl-cert 4096 7月 8 2012 private/ I wonder what does this mean for group ...
2
votes
2answers
5k 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
2answers
63 views

relation between chmod and sudo on an executable file

What is the relationship between chmod and sudo on an executable file for a user? Are the cases that "a user needs sudo to run an executable" the same as the cases that "chmod hasn't set the ...
1
vote
3answers
107 views

Reverse a chmod command on a directory

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