Hot answers tagged


On Ubuntu you use "www-data" because that is the user the Apache process runs as. You can identify the user Apache will use by checking the config file. On my Mac, it looks like this: $ cat /etc/apache2/httpd.conf [...] User _www Group _www [...] So one way to make your files writable would be to chgrp them to _www.


For standard unix permissions you must always consider, the owner (user/group/other), permission bits, and the umask. The combination of these things are what describe your effective rights, and the permissions of new items. chown/chgrp set the ownership. chmod set the permssions the umask is part of each users environment and depending on how it is set, ...


FAT does not have permissions; you could try either re-mounting the device with different owner/group/umask, or expanding the archive flag and removing "preserve permissions" flag -p "preserve groups" flag -g "preserve symlinks" flag -l "preserve special & device files" flag -D Essentially rsync -rt is good enough for a FAT target. The lazy option ...


If you want to do this with an existing folder, you need to make sure the setgid bit is enabled for all subfolders as well. However, you don't need it on files, and you probably don't want it on files either. Here is how to set it for all subfolders recursively. find /path/to/base/dir -type d -exec chmod g+s {} +


I cannot find the source back, but using setgid to solve this issue for bare git repositories, which I assume is your case, is deprecated, and can cause issues in some cases. Git can take care of all this via the core.sharedRepository flag. I had the same issue and solved it as follows: Assuming repogroup is your group, and you have cd to the repo ...


The trailing . indicates that a file has an SElinux security context. To set the default security contexts you should be able to run restorecon -r /usr/hdp The above requires that you have SELinux enabled on your system. If you do not then you will have to enable it and label the filesystem Edit /etc/selinux/config and ensure that SELINUX=enforcing # ...


Because the group doesn't have suitable permissions on the files and directories on and within testdir.


If your users'websites are separated in virtualhost, a simple and secure ways in most cases would be to use apache2-mpm-itk, which allows to constrain each individual vhost to a particular system user/group. After installing apache2-mpm-itk, add these lines in part of apache configuration: <virtualhost> ... <IfModule ...


The umask setting influences the permission bits on the newly created files and directories. It doesn't influence the ownership. You could add the user who uploads the files to the www-data group. A umask of 022 in the FTP server would then make sure that these files are readable by the webserver but not writeable. If you also use PHP, you could set up ...


I think what Mike Scott is trying to explain is that only root, or someone elevated with sudo, can use the chgrp command.


You either need to make www-data a member of mygroup or use the superuser account to make the change. In either case, you'll need root access or somebody with root access to help you.


umask sets the permissions on a file, not the ownership. You can use chgrp www-data <dir>; chmod +s <dir> to ensure that all files created in that directory are owned by the group www-data. I don't believe there's a way to change the owner as well but with proper group permissions that shouldn't be necessary.

Only top voted, non community-wiki answers of a minimum length are eligible