A Unix tool for changing file permissions

learn more… | top users | synonyms

142
votes
2answers
11k views

Why is “chmod -R 777 /” destructive?

This is a Canonical Question about File Permission and Why 777 is "destructive". I'm not asking how to fix this problem, as there are a ton of references of that already on Server Fault ...
35
votes
6answers
39k views

How to setup linux permissions for the WWW folder?

Updated Summary The /var/www directory is owned by root:root which means that no one can use it and it's entirely useless. Since we all want a web server that actually works (and no-one should be ...
14
votes
1answer
6k views

What does the @ symbol mean in a file's permission settings?

I'm on MacOSX, I did ln -s on a directory and these are the results: -rwxrwxr-x@ 1 shiki admin 970332 Mar 6 16:38 apc.so -rwxrwxr-x@ 1 shiki admin 653884 Mar 6 16:38 eaccelerator.so ...
8
votes
4answers
2k views

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?
5
votes
3answers
4k views

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 ...
5
votes
4answers
2k views

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?
5
votes
3answers
6k views

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 ...
5
votes
3answers
4k views

How do I copy ACLs on Mac OS X?

Most unix derivates can copy ACLs from one file to another with: getfacl filename1 | setfacl -f - filename2 Unfortunately Mac OS X does not have the getfacl and setfacl commands, as they have ...
4
votes
4answers
356 views

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: ...
4
votes
2answers
288 views

Accidential CHMOD 755

Alright, I accidentially chomdded everything to 755, which isn't as terrible as chowning everything to the local user. How insecure is this and how would I restore it easily, without reinstalling?
4
votes
2answers
7k views

what chmod and owner:group settings are best for a web application?

we are configuring a PHP web application on CentOS and have all our files currently in /var/www/html/project/ Apache is configured to run as apache:apache and has access to the directory above. Right ...
4
votes
1answer
708 views

Undoing chmod 777

Sometimes in desperation, to test if my problem is not the permission problem I do: sudo chmod -R 777 mydir/ In most cases it does not helps, and now I have two problems ;) Files inside mydir/ had ...
4
votes
1answer
2k views

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 ...
4
votes
1answer
349 views

Still confused by Permissions - linux, nginx, php-fpm

I have read the canonical answer at What are the best linux permissions to use for my website? However I'm still stuck. My setup is: A developer user 'ade' who owns the directories and files that ...
4
votes
1answer
190 views

chmod -R 777 on PXE server - why

So I am following a guide to set up a PXE server, for reference here are the links: Actual PXE setup NFS PXE setup Live-cd PXE setup: Now throughout these guides he keeps running the chmod -R 777 ...
4
votes
2answers
699 views

setfacl equivalent to chmod for setting/unsetting individual flag

Using setfacl command line arguments, is there a way to set/unset a single flag as the following command will do ? chmod g+x FILE Please note that: setfacl g::x FILE setfacl g::--x FILE are ...
3
votes
6answers
791 views

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 ...
3
votes
3answers
27k views

chmod -R 777 / on ubuntu - numerous problems

A client has accidentally given the entire filesystem full permissions on their ubuntu 10.04 box. chmod -R 777 httpdocs/cd / As you can see they attempted to cd to the root, and instead gave chmod ...
3
votes
6answers
3k views

Is there a way to run chmod on Windows

Is there a way to run the chmod command on Windows?
3
votes
4answers
1k views

How to restore remote access to a RHEL system from expanded permissions set over the entire filesystem? [duplicate]

Cause of the problem I intended to add group write permission on hidden files like '.hgignore' with the following: # pwd /opt # sudo chmod -R g+w .* The problem is that '..' matched this pattern, ...
3
votes
2answers
2k views

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 ...
3
votes
4answers
2k views

Why is it so important to remove 777 permissions?

I'm writing installer for my PHP web app. It requires user to change permissions of a few files and directories (config.php, cache, uploads, .htaccess) to 777 (so that it's writable). I've seen in ...
3
votes
3answers
262 views

Maintain setgid bit (after bower install or gulp build)

We run web servers where we have the following situation: The www-data user runs the web server and must have read+write access to the files The deploy user deploys all the code The bob and alice ...
3
votes
3answers
1k views

Allow PHP to write file without 777

I am setting up a simple website on webspace provided by my university. I do not have database access so I am storing all the data in a flat file. The issue I am experiencing is related to file ...
3
votes
3answers
842 views

Alternative to having directories with 777 permissions

I am running several websites on my dedicated server and a lot of my sites require that some directories have permissions set to 777. I know this is a major security issue, and I also know it's ...
3
votes
2answers
4k views

rsync - failed to set permission - operation not permitted

I got the following command with this error rsync -avz --links -O /home/jansiatest/.jenkins/workspace/svn_to_demo/trunk/CPS/ jansia@ps27670.dreamhost.com:/home/tasklite/temp sending incremental file ...
3
votes
1answer
417 views

centos 6.2 gives read permission denied when root has set read permissions to all users

Installing Dropbox on Centos 6.2 owned by root. Demonstrating that the dropbox folder is owned by root with read permissions to all "root" user gives read permissions to all users [root@localhost ...
3
votes
5answers
626 views

Chmod: defintion of everyone (777)

If I Chmod a directory a to 777. What exactly does Everyone mean? Anyone who connects with FTP without using the password or something else? I have a Wordpress CMS and I'm trying to install a plugin, ...
3
votes
4answers
913 views

What are the cons of restricting chmod to root/sudo users?

I have an issue with some of my users misusing chmod by doing things like chmod 777 ~ -Rf I'd like to disable chmod so that only users with full sudo rights (I.E. IT) have rights. Are there any ...
3
votes
1answer
2k views

Only allow a user to CHMOD and CHOWN in their home directory or a specified directory

I have a Windows user on my network who has Samba access to our linux development server. Occasionally permissions or ownership will become confused for reasons unknown and he will no longer be able ...
3
votes
2answers
9k views

Using chown to change the group owner of a directory is not permitted…Why?

I am trying to execute chown on a directory that has the following permissions and owners: drwxrwxr-x 2 justin devs 4096 Jan 1 20:42 test I am trying to simply execute the following as the justin ...
3
votes
5answers
8k views

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 . ...
3
votes
3answers
3k views

How to allow members of a group to change file permissions on linux

I need to allow members of the group 'ftpusers' to be able to change permissions on all objects inside a certain directory. I was looking into how to do it but all I have found is how to do it on BSD: ...
3
votes
1answer
54 views

How to run a recursive chmod that stop at FileSystem Boundaries

I have a directory with lots of files and inside a mounted directory. var/ log/ nfs/ (a NFS remote directory) www/ How can I chmod/chown everyfiles inside that directory without changing ...
3
votes
2answers
3k views

root directory permissions changed to 777 by mistake whats now?

By Mistake on Ubuntu 9.04 my colleague has changed the permissions to 777 on root directory (/) whats the best way to recover the permissions ?
3
votes
2answers
1k views

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 ...
3
votes
3answers
7k views

vsFTPd default uploaded file permissions on Ubuntu not working

I have a Server running Ubuntu 12.10 x64, and the last version of vsFTPd. My user example.com has its home folder set on /var/www/example.com, I created a public_html folder inside and gave 777 ...
2
votes
4answers
3k views

CHMOD - Applying Different Permissions For Files vs. Directories

I've been trying to clean up permissions on a few boxes and have been scouring the chmod man as well as all the internet documentation that I an handle without any luck -- so here we go. Basically, ...
2
votes
4answers
355 views

Why do many linux files have others=read access?

Can I run chmod o=- -R / ? I don't want a newly created user to be able to cat /etc/passwd, just because of its default permissions. And I want to understand why these defaults were chosen for ...
2
votes
1answer
11k views

Is CHMOD 775 safe to use?

I know it's not good to use CHMOD 777, but is 775 as dangerous? Does it provide a backdoor to hackers as easily as 777?
2
votes
2answers
240 views

Make files editable for guests without using chmod

Sorry if this is the wrong place to post this, or if it has been posted before. I couldn't find anything though. If I log on to a linux server without supplying a username or password (from windows ...
2
votes
3answers
740 views

Cross-group file permissions in Linux

I have 2 users: Alice and Bob and 2 groups: Management and Personnel. Alice has primary group Management, and secondary groups Personnel and Alice. Bob has primary group Personnel and secondary group ...
2
votes
4answers
156 views

How to own a folder and use by 3 users

3 users, 1 folder. Users: vsftpd (FTP server), bobmarley (normal user), www-data (Apache user) How to unite them and make so that each user can modify any of these user's data, without doing CHMOD ...
2
votes
4answers
683 views

how to change permissions of specific file type

file * | grep 'ASCII text' | chmod -x chmod: missing operand Try `chmod --help' for more information. The above command gives me error.Basically I am trying to find all the files whose type is ...
2
votes
2answers
263 views

ls permission denied even with execute permissions

I chowned recusively /srv/site to www-data:www-data and chmodded it recursively with ug+rwx. I then added myself to group www-data. $ sudo usermod -a -G www-data cyrus $ sudo chgrp -R www-data ...
2
votes
2answers
112 views

Unix Group Permissions

I have created a directory and chown to have permissions master:webmaster and chmod the folder to 775 hence group writeable. So why is it i bert as a member of webmaster cant mv the directory or ...
2
votes
2answers
2k views

Setting up user permissions for new user

I want to add a new user to my CentOS 6 server (let's call him Barry). I've made the user account Barry and added him to a group I created called webusers like this: groupadd webusers useradd -G ...
2
votes
1answer
328 views

Cannot find command after reboot even though chmod +x was successful?

Dealing with a weird problem on CentOS trying to add the Play! framework to my path. Just earlier I successfully did a chmod +x play on Play! and I could run commands. Then I rebooted and it ...
2
votes
1answer
1k views

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?
2
votes
2answers
3k views

Limit sudo to only one directory and it's subdirectories by sudoers file

So I would like to limit Apache to only change permissions in a certain folder and all of it's sub-directories, so this is what I have in my sudoers file apache ALL= (ALL) NOPASSWD: /bin/chmod -R ...