persisting file ownership

Brandon Stout bms at mscis.org
Fri Feb 2 14:22:31 MST 2007


Daniel wrote:

> Jeff,
>
> you said:
>> 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.
>
> 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
> be.
>
> -Daniel
>
> 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 

I believe if you simply add shell access to whatever user name HTTP
Server uses, and log in as that user, you should be able to use gedit to
modify/write the files.  This assumes the apache user has write access
on the parent directory.  If logged in under the HTTP Server user name,
you'll save files under that name also.

Brandon Stout
http://mscis.org




More information about the PLUG mailing list