Date: Wed, 11 Feb 2009 19:18:43 +0100 From: Roland Smith <rsmith@xs4all.nl> To: Keith Palmer <keith@academickeys.com> Cc: freebsd-questions@freebsd.org Subject: Re: Restricting users to their own home directories / not letting users view other users files...? Message-ID: <20090211181843.GA41237@slackbox.xs4all.nl> In-Reply-To: <53134.12.68.55.226.1234369337.squirrel@www.academickeys.com> References: <53134.12.68.55.226.1234369337.squirrel@www.academickeys.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 11, 2009 at 11:22:17AM -0500, Keith Palmer wrote: >=20 > OK, I'm sure this question has been asked a million times, but I havn't > been able to find a straight answer that actually solves the problem, so > here goes. >=20 > We have a FreeBSD server with multiple users. I would rather each user > *not* be able to view other users' files via an SSH or SFTP session. i.e. > if I'm logged in as "keith" I should *not* get a list of files when I do > "ls /home/shannon" >=20 > I realize I can fix this by setting the permissions on the "/home/shannon" > directory to 700. *However* then Apache (running as user "www") won't > display the documents in "/home/shannon/public_html" from > "http://ip-address/~shannon/", instead returning a "403 Forbidden" error. >=20 > Sooo... how can I set this up so that users can't view other user's files, > but Apache still works? Chmod the homedirs to 700. And write a script that copies the user's html files/directories (if they have changed) to a location where apache can access them. Run this script as a cronjob for root. Alternatively, maybe you could use ACLs to grant group www access of the home directories. See setfacl(1). [I've never had the need to try this, so I'm not sure]. Roland --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --TB36FDmn/VVEgNH/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAkmTFoMACgkQEnfvsMMhpyVmSwCeJODrxU6wwzQ7AEyL/hq3vyYU 3p8AoJAu58BP3zai45hTcnXYdMA+HhNV =Kvfm -----END PGP SIGNATURE----- --TB36FDmn/VVEgNH/--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090211181843.GA41237>