Best files permissions for htdocs folder?

Hello,
soon I set up a web server on openSuSe. Everything is working fine, but I think about something today. Now I make a group hosting, and I have 3 users in this group that need to access the htdocs folder for the web site-s. This users use SFTP to access the server. I make the folders in htdocs to be owned by this group hosting. Now everything is fine, but I have one script on the site that need to upload pictures in one folder. Now I make permissions of this folder as 777, but I don’t like this. Can you tell me some other setup for a situation like this?

DSDimitrov wrote:
> soon I set up a web server on openSuSe. Everything is working fine, but
> I think about something today. Now I make a group hosting, and I have 3
> users in this group that need to access the htdocs folder for the web
> site-s. This users use SFTP to access the server. I make the folders in
> htdocs to be owned by this group hosting. Now everything is fine, but I
> have one script on the site that need to upload pictures in one folder.
> Now I make permissions of this folder as 777, but I don’t like this. Can
> you tell me some other setup for a situation like this?

Have the script upload pictures to one directory only. Note that the process
writing such a file is wwwrun, so you only need to give write access to
that user.

Kind regards,
Andreas Stieger

So it will be also OK if I make owner of htdocs the group www, and add my users as member of this group. In this case I will make the upload directory with 775 mode. Is this setup also OK? Or it’s better to give write access to the upload directory to this wwwrun user?