I wonder umask default permission include file - permissions

If umask value is 022.
i know new file permission is 644 and new dir permission is 755.
But I wonder where (or which file) include file, dir permission is 666 and 777?
(p.s. sorry, i am not good at english)

Related

The softlink create by me can NOT be access by others

I make a folder "target" in my home and I change its mode to 777 (drwxrwxrwx), I create a softlink in /tmp folder,in /tmp folder.
ln -s /home/[myusername]/target target
I can read,write to the softlink target(lrwxrwxrwx) , but others can NOT access this softlink .why?
the /tmp folder permission in linux system is 'drwxrwxrwt', the last is 't'.
this permission can not access other's folder.
I create the a softlink by root user. solve it .

Unable to check htaccess file

I am new to php and drupal. After i completed work on site in locally i run it but shows below error in log/error.log
Permission denied: [client 127.0.0.1:37590] AH00529: /home/user/public_html/domainname.com/public/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/user/public_html/domainname.com/public/' is executable
I gave 777 permission to public folder below like this
chmod -R 777 public/
after i googled i changed the permission to .htaccess file
chmod 644 .htaccess then
I gave permission to parentdirectory (public) folder
chmod 755 public/
then again i installed new one locally(new site) but it shows the same error
but still it shows same error.
Can any one help me from this?
Open the httpd.conf (or apache2.conf) file and search for the User and Group directives. The values here refer to the user/group which will be used for Apache server.
Next, go to /home/user/public_html (or /home/user/public_html/domainname.com whichever is the DOCUMENT_ROOT) and do this:
sudo chown -R USER:GROUP ./
where USER and GROUP are the values of User and Group directives from above. Once that is done, set the htaccess file permissions to 0644 and try.

Drush make directory is not writable

I am running a drush make and getting the following error
Directory /Applications/MAMP/htdocs/geoslate/sites/default exists, but is not writable. Please check directory permissions. [error]
Unable to copy /tmp/make_tmp_1365076314_515d695acefc3/__build__/sites/default to ./sites/default. [error]
Cannot move build into place
I am not an expert on permissions in the terminal, can you give me a hand to give the directory the write permisions. I have tried chmod -w /Applications/MAMP/htdocs/geoslate/sites/default and chmod u+x /Applications/MAMP/htdocs/geoslate/sites/default
chmod +w <directory> solved the problem

cd'ing permissions denied after enabling root user on mac os x 10.6.4

I enabled root in terminal by sudo passwd root and then attempted to cd a rails site folder located on my desktop. I got the error -bash: cd: /Users/fred/Desktop/sitefolder: Permission denied
How to get rid of this error/ enable all permissions for root? Thanks
Are you sure you called cd as root?
If yes, check if the owner of the folder is root. If not call
sudo chown /Users/fred/Desktop/sitefolder root
then check if the owner has reading permission. If not call
chmod 744 /Users/fred/Desktop/sitefolder
(this enables all permissions for owner and only reading permission for group and others). If you don't care much about that folder you may instead call directly
sudo chmod 777 /Users/fred/Desktop/sitefolder
giving all permissions to every user.

Files saved by my web application has different file permissions from parent

I have a folder in which new subfolders and files will be created automatically, by a script.
I want to maintain the user and group permissions recursively for all new folders and files placed in the parent directory. I know this involves setting a sticky bit, but I can't seem to find a command that shows exactly what I need.
This is what I have done so far:
sudo mkdir -p /path/to/parent
sudo chmod -R 660 myself:somegroup /path/to/parent
Thereafter, I want the 660 permissions to be set recursively to any folders and files placed in /path/to/parent
However, whenever Apache saves a folder/file it assigns it permissions of 700 with user and group set to the apache user. This is NOT what I want. I want all files/subfolders under the parent to have 660 permissions for myself:somegroup.
Actually the octal flag 660 is probably not even correct. The permissions I want are:
Directories placed under /path/to/parent are eXecutable by users with permissions
files are read/writeable by user myself and members of somegroup
Files and folders in /path/to/parent is NOT world readable
Can someone help please?
I am running on Ubuntu 10.0.4 LTS
sudo mkdir -p /path/to/parent
sudo chmod -R 660 myself:somegroup /path/to/parent
erm - not ideal.
If you want new files/dirs created to have the same group ownership you need to set the group sticky bit on directories
find /path/to/parent -type d -exec chmod g+s {};
And you need to make directories executable:
find /path/to/parent -type d -exec chmod ug+x {};
...
However, whenever Apache saves a folder/file it assigns it permissions of 700 with user and group set to the apache user
Then you also need to set the umask (0770) for the executing code (or directly change the permissions) and ensure the apache uid is a member of somegroup. IIRC to set the group sticky bit, umask should be 2770 - but do check the manual.
You can set apache to write new files with specific umask.
Todo so in RedHat/CentOS edit the file /etc/sysconfig/httpd, and change to:
umask 007
In debian/Ubuntu use the file /etc/apache2/envars with the same settings