-1

I'm setting up a shared server on Ubuntu 14.04 for my team to be able to upload files to be served via Apache. I'd like to give each user an SSH/SFTP login that they can use to upload files via SFTP, SCP, rsync, SSH, etc.

I keep running into permission issues where new files and folders within the shared folder are not group writable. I've tried several solutions including setting the UMASK and even using ACL - my conclusion has been that the files maintain the permissions from the source machine when uploaded to the server.

My question is: What is the generally accepted best practice for doing this, short of giving everyone a single login to the server? This can't be that complicated, just having a folder (e.g., /var/www/html) where multiple users in a group can edit everything. I see it happen on crappy hosts like our old GoDaddy shared hosting all the time, where you can go into cPanel and set up multiple users with access to the webserver directory.

Thanks - server admin newbie here! I've spent several hours trying to resolve this issue.

1
  • As a hack, what about formatting the filesystem as VFAT, and mounting that group writeable ?
    – davidgo
    Jul 21, 2015 at 2:07

2 Answers 2

0

Based on the question it seems like the simplest solution would be either

  1. Give users their own logins on the system
  2. Tie into existing organizational infrastructure and use that for authentication.

LDAP and NIS are both common solutions for allowing login/authentication across a domain/network for ensuring that permissions and ownership of files works correctly on several systems.

Both have advantages and disadvantages, determining the appropriate solution for your organization depends on things like number of users, number of systems, network environment and a host of other factors.

2
  • This is probably more overhead than I want. This is a simple solution - 5-10 people SFTPing into a server. My question is mainly around how to set up that directory so everyone can read/write everything inside of it, including all new files and folders that get created. Jul 21, 2015 at 1:09
  • The easy solution is to have everyone login as the same user if everything in the directory needs to be readable and writable by anyone else with access to the directory and file permissions/ownership is not that important.
    – Matt
    Jul 21, 2015 at 1:12
0

Definitely don't give everybody a single login. You can go through the process of setting up all the users in a single group, making sure the file's are written with group permissions. These days it's often a good idea to use something like github for storing the files (and tracking revisions/changes) and then pulling from github using a webhook.

1
  • That's been my approach so far. My issue is when users SFTP into the server using a client like Transmit or FileZilla, those new files don't respect the defaults. That's why I was curious if this is the right approach. Jul 21, 2015 at 1:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .