[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: chmod problem



On Tue, Feb 06, 2001 at 10:16:14AM +0800, Ian Eblamo <ageblamo cepalco com ph> wrote:
| I had made my own public_html. I set the folder to mode 755 for it to be viewe
d by others and group. When i added a new html file on it, i had to go to the fo
lder and issue the command chmod 755 $filename. Is there any other way that each
 time i add a new file, it would automatiacally inherit the folders share proper
ty?

[ Please press ENTER every 70 characters or so. Thanks. ]

Basicly you must either
	- adjust the permissions after you make a new file
or	- set your umask to 022

The umask is the property which governs the default permissions of new files.
Is specified which permissions _not_ to set on the file. So 022 (an
octal number) says:

	0	set all permissions for the owner 
	2	set all except write for the group members
	2	set all except write for everyone else

This mask is used against the create permission set used by the editor
when it makes a new file. For directories this is 777 (rwx in all three
permissions) and after the umask becomes 755. For files this is normally
666 (read and write in all three positions) which becomes 644 because
of the umask.

Compilers are pretty much the only exception to this scheme - their
final executable needs execute, so they create that with a permission
set of 777, which your umask would munge back to 755.

You can set you umask at the shell prompt like so:

	umask 022

You can place the same comme in the file ~/.profile to have it take effect
at your next and subsequent logins. The command

	umask

with no argument reports the current umask setting.

Cheers,
-- 
Cameron Simpson, DoD#743        cs zip com au    http://www.zip.com.au/~cs/

Follow! But! Follow only if ye be men of valor, for the entrance to this cave
is guarded by a creature so foul, so cruel that no man yet has fought with it
and lived! Bones of four fifty men lie strewn about its lair.  So,
brave knights, if you do doubt your courage or your strength, come no
further, for death awaits you all with nasty big pointy teeth.
- Tim The Sorceror





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]