persisting file ownership
Michael L Torrie
torriem at chem.byu.edu
Fri Feb 2 13:06:25 MST 2007
On Fri, 2007-02-02 at 13:03 -0700, Daniel wrote:
> This is what I want to do. I can open files on a remote server
> through gedit and it uses ssh/sftp. I save the file and it saves it
> on the remote server. I don't manually scp or sftp the file to the
> remote server. Is there a setting on the client or server side that
> needs to change? I am willing to change config files for ssh if need
If you set the parent folder on the server to setgid (chmod g+s) then
any file written to that folder will assume the group that the parent
folder has. This of course won't do anything about the actual ownership
(which usually isn't a problem if the group is apache -- you must be a
member of it), nor will it enforce any particular umask.
> On 2/2/07, Jeff Schroeder <jeff at zingstudios.com> wrote:
> > Daniel asked:
> > > What can I do to force the apache user and group to own the
> > > php scripts?
> > You'll need to upload them to the server as that user. Assuming you're
> > using SFTP or scp or (yuck) FTP, if you login as the Apache user, the
> > files you create will be owned by that user.
> > A slightly more complicated approach that works with FTP is to set the
> > ownership of all files in a certain directory, so that no matter who
> > you login as, any files will be assigned that ownership. I don't know
> > if SFTP/scp have this capability.
> > And of course the last resort is to use 'chown' to update them after
> > they've been uploaded. You may need to be logged in as root to do
> > that, however.
> > HTH,
> > Jeff
> > /*
> > PLUG: http://plug.org, #utah on irc.freenode.net
> > Unsubscribe: http://plug.org/mailman/options/plug
> > Don't fear the penguin.
> > */
> PLUG: http://plug.org, #utah on irc.freenode.net
> Unsubscribe: http://plug.org/mailman/options/plug
> Don't fear the penguin.
More information about the PLUG