Fred Stluka on 4 May 2010 19:43:48 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] How to share write access to files via scp?...

  • From: Fred Stluka <fred@bristle.com>
  • To: "Philadelphia Linux User's Group Discussion List" <plug@lists.phillylinux.org>
  • Subject: Re: [PLUG] How to share write access to files via scp?...
  • Date: Tue, 04 May 2010 22:43:43 -0400
  • Authentication-results: cm-omr9 smtp.user=fred; auth=pass (LOGIN)
  • Organization: Bristle Software, Inc.
  • Reply-to: Philadelphia Linux User's Group Discussion List <plug@lists.phillylinux.org>
  • Sender: plug-bounces@lists.phillylinux.org
  • User-agent: Thunderbird 2.0.0.24 (Macintosh/20100228)

Sean,

Yeah, I started looking into ACLs.  Have to enable them for the
volume in /etc/fstab, and then use setfacl/getfacl to manage them.
OK.  I can do that.

Can I set an ACL on a directory that will cause the files created
there via scp to inherit world- or group-write permissions?  Will
subdirectories inherit also, recursively?  Will the file owner be
updated properly when scp overwrites a file?

Thanks!

P.S.  Looks like I accidentally sent in HTML format last time.
      Going for plain text this time, and appended my original
      question below Sean's reply for those who don't see HTML
      formatted messages.

--Fred
---------------------------------------------------------------------
Fred Stluka -- mailto:fred@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
---------------------------------------------------------------------



Sean M. Collins wrote:
> Use ACLs.
>
>   

Linux gurus,

Any suggestion for how to set up a directory on a Linux server to
support write access by different users via scp?

I want any user with a valid username/password to be able to use
scp to create new files, and to overwrite files put there via scp
by others.

I have Googled and read quite a bit, and have tried the following:

- Create a writeable directory:
  % sudo mkdir       /var/share
  % sudo chmod 777   /var/share
  - Good:
    - Various users can now write new files to /var/share via scp
  - Bad:
    - Users cannot overwrite existing files written there by other
      users.

- Put all users in a group called team, set the group of the
  directory to team, and set the SGID bit of the directory.
  % sudo groupadd team
  % sudo usermod -a -G team user1
  % sudo usermod -a -G team user2
  % sudo usermod -a -G team user3
  % sudo chgrp team /var/share
  % sudo chmod g+s  /var/share
  - Good:
    - Various users can now write new files to /var/share via scp, and
      can overwrite existing files written there by others users IF g+w
      bit is set on the files.
  - Bad:
    - When user creates file via scp, default is g-w, regardless of 
umask.  Why?
    - When user overwrites file via scp, the owner doesn't change.  Why?
    - Directories created recursively via scp do not inherit the g+s 
bit.  Why?

Any thoughts?  Thanks!

--Fred
---------------------------------------------------------------------
Fred Stluka -- mailto:fred@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
---------------------------------------------------------------------


___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug