A Unix tool for changing file permissions
Questions tagged [chmod]
248 questions
10
votes
4 answers
Can a file that is executable be read?
If a file has permissions -rwx-wx-wx can it be read by other and group users, or can it only executed and written? Is there some way to read an executable file by executing it?

Tom
- 731
- 3
- 11
- 24
8
votes
3 answers
Change all file permissions to 644 and all folder permissions to 755 recursively
How to change all file permissions to 644 and all folder permissions to 755 recursively using chmod in the following two situation:
If they had 777 permissions
Regardless of the permission (with ANY permissions)

smhnaji
- 619
- 2
- 11
- 24
7
votes
2 answers
Why would chmod give "No such file or directory" when running recursively?
I can change the permissions of the file directly:
# chmod --changes --recursive ug+rwX /var/www/shared/tmp/cache/assets/BA0/280/sprockets%2F286302903364106648b609d708884f78
and I can also change the permissions of the directory that contains…

Pablo Fernandez
- 7,438
- 25
- 71
- 83
7
votes
2 answers
Still confused by Permissions - linux, nginx, php-fpm
I have read the canonical answer at What permissions should my website files/folders have on a Linux webserver?
However I'm still stuck. My setup is:
A developer user 'ade' who owns the directories and files that comprise a website
The server is…

Ade
- 699
- 3
- 10
- 21
7
votes
4 answers
Make recursive chmod faster
I have an installation script that unzips a directory, then recursively chmods its contents.
I'm surprised it takes almost 10 times the time it takes to unzip, to run the following two commands:
find $dir -type f -exec chmod a+r "{}" \;
find $dir…

BenMorel
- 4,507
- 10
- 57
- 85
7
votes
4 answers
Change group ownership of Folders with chmod g+s
I have a folder hierarchy that I want to change the group ownership including any subsequent file/folder additions. I was going to use chmod g+s but I'm not sure if it applies to already created folders and how I run that with the group name.

mike628
- 309
- 2
- 5
- 10
6
votes
1 answer
chmod 1777 or 3777 on /tmp
Is there an ideal chmod for /tmp (with /var/tmp symlinked to /tmp)?
I've seen people mention it both ways just curious as to the difference.
Is it a security difference?

Tiffany Walker
- 6,681
- 14
- 56
- 82
6
votes
6 answers
Correct recursive chmod, separate for files & dirs
I'd like to recursively chmod a directory so that:
Files are 0664
Directories are 0775
How to do it better, shorter, fancier? :) Maybe, use umask somehow?
All find solutions are too long: I always end with Copy-Paste :)

kolypto
- 11,058
- 12
- 54
- 66
6
votes
2 answers
What exactly does this dpkg command do?
I fixed a permissin problem for nagios like discribed here.
The command was:
sudo dpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rw
sudo dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3
Okay its obvious…

The Shurrican
- 2,240
- 7
- 39
- 60
6
votes
4 answers
Making Apache able to write to PHP files with PHP running as DSO?
I have PHP running as a DSO. As such, my installer script (which writes to a config file) can't do any writing.
How do I give apache (user: nobody) the ability to write to the file?

Rob
- 2,393
- 9
- 33
- 52
6
votes
3 answers
chmod all files (including hidden files) in a directory in Linux (not recursively)
Yesterday I did something stupid which I today realised. I ran:
/root# chmod o-rwx * .*
This supposed to remove read, write and execute permissions for the world on all files in the current directory (/root). As soon as I did this, screen behaved…

Lekensteyn
- 6,241
- 6
- 39
- 55
5
votes
5 answers
is it safe to chmod 775/664 with owner www-data:www-data?
To make working with my webserver easiest I am proposing doing something like the following:
sudo chown www-data:www-data /var/www -R
cd /var/www
sudo find . -type f -exec chmod 664 {} \;
sudo find . -type d -exec chmod 775 {} \;
I have my…

Alex Hadley
- 151
- 1
- 1
- 5
5
votes
3 answers
Apache "No Permission" - 403 forbidden
I've accidentally performed a wrong chown update this morning and now my /var/www permissions are all wrong.
I'm unable to access anything anymore, apache will always say I do not have permission to view this page, like:
You don't have permission…

Jelle De Loecker
- 1,094
- 6
- 17
- 30
4
votes
2 answers
SaltStack: How to work around "file.recurse doesn't preserve permissions"?
How to work around Recursive directory management doesn't preserve permissions?
I want to copy all files in (local) /monitoring/files/etc to /etc on the minion.
copy_files_in_etc:
file.recurse:
- source:
- salt://monitoring/files/etc
…

guettli
- 3,591
- 17
- 72
- 123
4
votes
1 answer
Permission Hierarchy possible in OpenSolaris + ZFS + ACLs?
I've been doing some research into OpenSolaris and ZFS for use in a NAS.
Thus far I have created the following:
/tank/projects
/tank/storage
/tank/developer
/tank/sandbox
The total space allocated for tank is 3.4Tb (RAIDZ2). Developers mount is…

Leah Calum
- 211
- 2
- 8