Date: Wed, 4 Apr 2007 13:36:01 +0200 From: "Christian Walther" <cptsalek@gmail.com> To: "Andrew Pantyukhin" <infofarmer@freebsd.org> Cc: FreeBSD-Questions <freebsd-questions@freebsd.org>, VeeJay <maanjee@gmail.com> Subject: Re: Help! User Permission Message-ID: <14989d6e0704040436p1c4373dcx3e5ca3d73890b2b4@mail.gmail.com> In-Reply-To: <cb5206420704040411n66059824padb1a6013789fc49@mail.gmail.com> References: <2cd0a0da0704040325n7d756c51t861852e983968e64@mail.gmail.com> <cb5206420704040411n66059824padb1a6013789fc49@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 04/04/07, Andrew Pantyukhin <infofarmer@freebsd.org> wrote: > On 4/4/07, VeeJay <maanjee@gmail.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14989d6e0704040436p1c4373dcx3e5ca3d73890b2b4>