How do I create a directory with read, write and execute permission in ubuntu 14.04.  I have a web-app written in php and I am using  &lt;?php mkdir('/items/folder', 0777, true); ?&gt;   to create folders but the its not assigning the right permission to my folders, even using chomd on my php script fails.  The app is on a digitalocean vps.OS is ubuntu 14.04.  What can I do?
122141
I having a weird problem on my VPS with Ubuntu 14.04 as the server. I tried creating a directory with php mkdir using the code below  &lt;?php      mkdir("/items/foldername", 0777, true); ?&gt;   Whenever i run this script,the folder gets created but with 755 permission instead of 777.  I have tried all available options I can see none is working. My php script is using www-data.   I have tried the following   sudo chmod -R 777 items  sudo chmod -R g+s items I added www-data to the root group
111310
I recently installed some PHP site on a server for a customer. A guy calls me up and tells me he can't seem to upload to the img directory. I went in and took a look at the owner of said directory.  The owner was set to a user named 518. I was still able to chown -R someuser img/ and fix the issue, but I am more concerned that the owner of the directory was set to 518. I have never seen the owner set as a number and I certainly did not set that owner myself. What does it mean when a user is set to 518? Did I get broken into? When I run cat /etc/passwd I do not see any user named 518 in there. I am running Ubuntu.
102892
I just ran the following command in a directory with several files, some owned by root, some by a normal user. I got a strange message:  $ sudo chmod -rwx * chmod: example-file: new permissions are ----w----, not ---------   Why the heck does chmod refuse to clear all permissions, if a file had group write rights? What is the thought behind this behaviour?  And is there a way to force removing all permissions in one step, without having to execute sudo chmod g-w * afterwards?
94251
I'm new to postgreSQL and I have a simple question:  I'm trying to create a simple script that creates a DB so I can later call it like this:  psql -f createDB.sql   I want the script to call other scripts (separate ones for creating tables, adding constraints, functions etc), like this:  \i script1.sql \i script2.sql   It works fine provided that createDB.sql is in the same dir.  But if I move script2 to a directory under the one with createDB, and modify the createDB so it looks like this:  \i script1.sql \i somedir\script2.sql   I get an error:     psql:createDB.sql:2: somedir: Permission denied   I'm using Postgres Plus 8.3 for windows, default postgres user.  EDIT:  Silly me, unix slashes solved the problem.
7201
Is there a linux command that I'm overlooking that makes it possible to do something along the lines of: (pseudo)  $ mkdir -R foo/bar/zoo/andsoforth   Or is there no alternative but to make the directories one at a time?
11833
Having installed the web server is there a simple way to set a user able to use the graphic interface to copy files and directories to the local web server /var/www  I gave myself administrative privileges in Ubuntu but it still doesn't allow copies.
95249
Is there some permissions setup that would allow a user, say, john, to add a file to a directory d, but not be able to remove an existing file owned by another user, say, root?   My understanding is that this is not possible, since one needs execute permissions to add a file to the directory, but this also gives on the power to unlink any file in the directory.  (I'm using Mac OS 10.9, but this question presumably applies to all POSIX-ish systems.)
76814
Can someone explain to me the following?  $ ls -ld /temp/sit/build/ dr-xr-s--- 3 asdf qwer 4096 Jan 31  2012 /temp/sit/build/  $ ls -ld /temp/sit/build/* ls: /temp/sit/build/*: Permission denied   So apprently, I can't use the asterisk here. I've tried it with a sudo command and I get a "no such file" error rather than "permission denied"...  sudo ls -l /temp/sit/build/* ls: /temp/sit/build/batch*: No such file or directory   but it finally works if I don't use the *  sudo ls -l /temp/sit/build/ total 4 dr-xr-s--- 11 asdf qwer 4096 Oct  3 23:31 file
114186
I have two users, user1 and user2, that are both members of groupA. user2 has a folder in their home directory called folderA. If they wish to allow read-write-execute permissions for all members of groupA, how would they do this?  What if folderA contains many files and additional folders that also need to have read-write-execute permission?  Information regarding groups is a little 'spotty' across the web, so I am putting my question here in the hope someone posts a clear answer that might help others out too.  Thanks!
85219
I want to set a folder such that anything created within it (directories, files) inherit default permissions and group.    Lets call the group "media".  And also, the folders/files created within the directory should have g+rw automatically.
17952
I have a /data folder (actually a partition) for all data that should be accessible by all users (in this case family members). We all have individual user accounts and are often all logged in at any time on this one PC.  How can I set up permissions so that we all retain access to files there no matter who creates them, including new folders? If I create a folder it gets my user and group, so nobody else can write to it.
43338
I am unable to call PHP files inside the Drupal directory. My task is maintaining staff's old pages on the new platform. With pages written on clear HTML, there is no problem: I place files in a folder I created (domain.org/sites/default/files/share/staff_folder).  In sites/default/files/.htaccess I added DirectoryIndex share and now the link to the domain.org/sites/default/files/share/staff_folder/index.html can be used. When I import pages written in PHP, e.g. calling domain.org/sites/default/files/share/staff2_folder/index.php, I get a 403 error:     Forbidden      You don't have permission to access /sites/default/files/share/staff2_folder/index.php on this server.   While /sites/default/files/share/staff2_folder/index.html still works.
8097
I would like to have a directory that has following properties:    Many users can copy files into it  These files can be deleted/changed by these users (user A can delete/modify file that was copied into this directory)    it cant be done using normal file permissions (because permissions are retained on copy).  Here is what I found on the net:        Some use cases:    Sharing music on local machine  Simple git repository sharing (just make a bare repository writeable to many people) --- i know that there are solutions like gitosis Allow many developers to modify test instance of php app without giving them root (i guess they would copy files) --- I'm leading a team of nonprofit junior developers and I need to keep that one simple!    EDIT  AFAIK setting SGID bit is not enugh, it only affects newly created files --- and basic workflow for these use cases ivnolves copying and other operations (which cleave file's gid unchanged)
89671
I have a shell script called boot.sh on an Ngnix server  I am trying to call it via PHP, but I don't think I have permissions.   How can I give www-data permission to run boot.sh - and only boot.sh  When trying sudo chown or sudo chgrp I am getting Operation Not Permitted
112544
What's wrong with the commands below?  $ var1="~/Music/$(date +%d%m%y)" $ echo "$var1" ~/Music/240118 $ mkdir "$var1" mkdir: cannot create directory ‘~/Music/240118’: No such file or directory   However  $ mkdir ~/Music/240118   works.  Never thought I would ask such questions after years of using bash...
83407
Within my web application directory, how can I change all my folder permissions to rwxr-xr-x (755)? And how can I change all file permissions to rw-r--r-- (644)? I want to change all folders and files including sub-sub files and folders.   I know the following command would change all files and folders but I want to discrimate between a file and a folder.  chmod -R 755 ./my_web_app_project
13585
This is a  about File Permissions on a Linux web server.   I have a Linux web server running Apache2 that hosts several websites. Each website has its own folder in /var/www/.  /var/www/contoso.com/ /var/www/contoso.net/ /var/www/fabrikam.com/   The base directory /var/www/ is owned by root:root. Apache is running as www-data:www-data. The Fabrikam website is maintained by two developers, Alice and Bob. Both Contoso websites are maintained by one developer, Eve. All websites allow users to upload images. If a website is compromised, the impact should be as limited as possible.  I want to know the best way to set up permissions so that Apache can serve the content, the website is secure from attacks, and the developers can still make changes. One of the websites is structured like this:  /var/www/fabrikam.com     /cache     /modules     /styles     /uploads     /index.php   How should the permissions be set on these directories and files? I read somewhere that you should never use 777 permissions on a website, but I don't understand what problems that could cause. During busy periods, the website automatically caches some pages and stores the results in the cache folder. All of the content submitted by website visitors is saved to the uploads folder.