Fred Stluka on 4 May 2010 16:51:41 -0700

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

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

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

- 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 Stluka -- --
Bristle Software, Inc -- -- Glad to be of service!

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --