From owner-freebsd-questions Thu Nov 29 22:49: 6 2001 Delivered-To: freebsd-questions@freebsd.org Received: from post.mail.nl.demon.net (post-11.mail.nl.demon.net [194.159.73.21]) by hub.freebsd.org (Postfix) with ESMTP id 8368637B417 for ; Thu, 29 Nov 2001 22:49:02 -0800 (PST) Received: from [212.238.194.207] (helo=tanya.raggedclown.net) by post.mail.nl.demon.net with esmtp (Exim 3.33 #1) id 169hTp-000APU-00 for freebsd-questions@freebsd.org; Fri, 30 Nov 2001 06:49:01 +0000 Received: by tanya.raggedclown.net (tanya.raggedclown.net, from userid 500) id E1A88110D; Fri, 30 Nov 2001 07:48:59 +0100 (CET) Date: Fri, 30 Nov 2001 07:48:59 +0100 From: Cliff Sarginson To: freebsd-questions@freebsd.org Subject: Re: change permission to default ? Message-ID: <20011130074859.B7131@raggedclown.net> References: <20011130043357.36971.qmail@web21103.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011130043357.36971.qmail@web21103.mail.yahoo.com> User-Agent: Mutt/1.3.22.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Nov 29, 2001 at 08:33:57PM -0800, Henry smith wrote: > I have make any changes with the permission of > directory/files. > > How do I make the permission set as default ? > This is a simplfied explanation...and assumes you know what an exclusive-or is. The permissions of a file depend on a thing called the umask (documented under the man page for sh/csh probably). This is a bit mask (think octal here). When you create a file the permissions it would get if the umask was 0 would be rw-rw-rw- This,if you like, in the absence of any qualification is the default. However no system will normally set a default umask of 0. As you will see it gives the world and it's mother read/write permission on the file. Thinking of rw-rw-rw as an octal number you will see it is 0666 The file creation algorithm XOR's this 0666 with the value of umask, so the XOR of 0666 and 0 is, 666. Most systems will have a default umask set of 022, or possibly 002. So: 0666 XOR 000 = 0666 = rw-rw--rw- 0666 XOR 022 = 0644 = rw-r--r-- 0666 XOR 002 = 0664 = rw-rw-r-- And if you are bing draconian, set umask to 066 0666 XOR 066 = 0600 = rw------- You can work out the other combinations from this I hope. Here is an eccentric one, 0664, I will let you work out what that does :) So you need to change the system wide profile to the umask you want, or a user can set it up in their shell startup script(s). -- Regards Cliff To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message