public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Michael Orlitzky <michael@orlitzky.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] {OT} Development framework with access restriction?
Date: Thu, 29 Sep 2011 13:23:23 -0400	[thread overview]
Message-ID: <4E84A98B.4070101@orlitzky.com> (raw)
In-Reply-To: <20110929091341.128242e2@zaphod.digimed.co.uk>

On 09/29/2011 04:13 AM, Neil Bothwick wrote:
> On Wed, 28 Sep 2011 19:23:30 -0700, Grant wrote:
> 
>> For some reason I thought SFTP would provide access control but now
>> I'm thinking it's just like SSH in that access control is based on
>> file ownership and permissions?  If that's the case, can anyone think
>> of a better way to control remote access to my files than chmod/chown?
> 
> ACLs.
> 

We went this route once too. We had a developer ($USER) who was supposed
to have access to just one subdirectory of /var/www.

I took notes, assuming /etc, /root, and /usr have correct permissions:

   1. A group named ssh_users was created. The $USER account was
      added as a member of this group.

   2. The ssh_users group was granted the ability to traverse /var/www:

      setfacl -m group:ssh_users:--x /var/www

      This is necessary to allow the $USER user to chdir into its
      home directory in /var/www/$HIS_HOME_DIR.

   3. A default ACL was set on /var/www which will apply to each new
      subdirectory created within it.

      setfacl -d --set u::rwx,g::rx,g:ssh_users:-,o::rx /var/www

      This prevents members of the ssh_users group from traversing any
      newly-created subdirectories of /var/www.

   4. The default ACL described above was applied manually to each of
      the existing subdirectories of /var/www:

      setfacl -m g:ssh_users:- /var/www/*

      Warning: At the time of writing, there were no regular files in
      /var/www, so the above command makes sense. Don't blindly run it
      again without checking.

   5. The $USER user was granted full read/write/traverse permissions
      on its home directory and all subdirectories/files contained
      therein:

      setfacl -R -m u:$USER:rwx /var/www/$HIS_HOME_DIR

   6. At this point, we need to change the default ACLs of every
      directory within /var/www/$HIS_HOME_DIR. This is so that, when
      $USER creates a new file/directory somewhere beneath its home
      directory, it has access to the newly-created file or directory:

      setfacl -d -R --set u::rwx,u:$USER:rwx,g::rx,o::rx /var/www
      /$HIS_HOME_DIR

      This command sets the default ACL recursively, and is smart
      enough to only apply the command to directories.



  reply	other threads:[~2011-09-29 17:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-26 20:01 [gentoo-user] {OT} Development framework with access restriction? Grant
2011-09-26 21:37 ` Michael Orlitzky
2011-09-27 11:27   ` Mick
2011-09-29  1:18   ` Grant
2011-09-29  2:23     ` Grant
2011-09-29  6:57       ` Jonas de Buhr
2011-09-29  7:32         ` Mick
2011-09-30 23:53           ` Grant
2011-10-01 11:07             ` Florian Philipp
2011-10-01 23:27               ` Grant
2011-10-02 22:41                 ` Mick
2011-10-03 22:01                   ` Grant
2011-10-03 22:12                     ` Michael Mol
2011-09-29  8:13       ` Neil Bothwick
2011-09-29 17:23         ` Michael Orlitzky [this message]
2011-09-30 23:59           ` Grant
2011-10-01  0:23             ` Michael Orlitzky
2011-10-01 23:46               ` Grant
2011-10-02 19:04                 ` Michael Orlitzky
2011-10-03 21:54                   ` Grant
2011-10-03 22:00                     ` Michael Mol
2011-10-04  4:25                     ` Michael Orlitzky
2011-09-27 12:19 ` Jonas de Buhr
2011-09-29  1:23   ` Grant
2011-09-29  6:43     ` Jonas de Buhr
2011-09-30 23:50       ` Grant
  -- strict thread matches above, loose matches on Subject: below --
2011-10-01  5:58 Pandu Poluan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E84A98B.4070101@orlitzky.com \
    --to=michael@orlitzky.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox