From owner-freebsd-questions@FreeBSD.ORG Wed Apr 4 11:36:05 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 467E116A403 for ; Wed, 4 Apr 2007 11:36:05 +0000 (UTC) (envelope-from cptsalek@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.170]) by mx1.freebsd.org (Postfix) with ESMTP id 9CCDE13C4C5 for ; Wed, 4 Apr 2007 11:36:04 +0000 (UTC) (envelope-from cptsalek@gmail.com) Received: by ug-out-1314.google.com with SMTP id 71so657992ugh for ; Wed, 04 Apr 2007 04:36:02 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=LRX++DQmuwdIVwaaW0jeuLzRX0KAPuYIhzf29DCsgSD2xZfSO4M91/64Zr57diOUS5Ld48TT6Seh6Iaf010K7MfUVGH3DVnMtvGc6YNQdXcSPSQU499VQXSEJOIBqdYcUTnYPPXZ5JKT48Lhn45u+Ycek4mRTk/T3dVWp+o4K8I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jHmNSkaE5BoT41YEJcqM/FcsR3Cje71vc5oMPk5x5mfEVYkDeKbOUURfZZALT2ycMb8IVzFR6hUSLNRCnvyAUtqgo3884i+GNMK6mRewRiYQWjCtSjd/LYfgVv0J1UDf6HTEaExglVWq2wGef6qGpzHs5X5aVodkab0To63/CjI= Received: by 10.82.113.6 with SMTP id l6mr572779buc.1175686561543; Wed, 04 Apr 2007 04:36:01 -0700 (PDT) Received: by 10.82.153.6 with HTTP; Wed, 4 Apr 2007 04:36:01 -0700 (PDT) Message-ID: <14989d6e0704040436p1c4373dcx3e5ca3d73890b2b4@mail.gmail.com> Date: Wed, 4 Apr 2007 13:36:01 +0200 From: "Christian Walther" To: "Andrew Pantyukhin" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <2cd0a0da0704040325n7d756c51t861852e983968e64@mail.gmail.com> Cc: FreeBSD-Questions , VeeJay Subject: Re: Help! User Permission X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2007 11:36:05 -0000 On 04/04/07, Andrew Pantyukhin wrote: > On 4/4/07, VeeJay wrote: > > Hello friends > > > > How can I restrict a user from getting in to an "Unauthorized folder" and > > getting directory list with using "ls" command? > > > > If he tries to cd to the unauthorized folder or tries to get directory > > listing so he gets "Permission denied" message? > > "chmod a-rwx folder" to deny all access to everybody, > then "chmod u+rwx folder" and "chown gooduser folder" > to permit a good user (and only him) to access it. Another option would be to remove access rights from "others" and make sure that the owner and group of the directory in question is set to something that excludes the user. If you want to allow access to a directory to only one user, the method described above is correct. But it doesn't work in case you want to prevent just one user from accessing a directory, but allow some others to do so. In the latter case you could create a group, for example "files", and you could add all users that are allowed to access the directory to this group. Then you chgrp the directory, do a chmod 750 on the directory, and you're set. chmod 750 actually prevents the group from writing to the directory, so if you want all group members to be able to write to this directory, use 770 instead. For more details please read some basic Unix manual, or check the manpages for pw, chmod, chown, chgrp... HTH Christian