Page 1 of 1

FTP to a 'nobody' owned directory?

Posted: Tue Jan 23, 2007 12:11 pm
by seodevhead
Hey guys... I created a directory on my website to allow a php application to create subdirectories and write files to. It all works fine and dandy with permissions set to 755, but now I want to upload to this directory a whole bunch of php files I created (another web application) and I also need to upload some other image folders and what not.

But since 'nobody' (or PHP) owns the directory, my FTP program (Smart FTP & WS_FTP) is telling me I cannot upload or fool with this particular directory - doesn't have permission.

What am I to do? How do I go about uploading my other php and image files to this directory now? Is there some kind of workaround? I really appreciate any help on this matter. Thanks so much.

Posted: Tue Jan 23, 2007 2:05 pm
by Christopher
First of all I would recommend using only SSH and SFTP (on Windoz use Putty and WinSCP).

Find out what group the "nobody" user is in (often "noone" or "web") and create a shell account that is also in that group. Then if you set the permissions to 775 both users should be able to write to that directory. Use that specific user (SFTP) just for that purpose. You only ever want to assign the minimum privileges to a user

Posted: Tue Jan 23, 2007 2:09 pm
by seodevhead
Hey arborint... Thanks for the response. I am not sure if I understand what you mean by "use SSH or PuTTy". I am on a windows machine, but rarely use putty/ssh to do anything (actually all I know how to do is use chown to change ownership of a folder).... but you are saying I can upload files using putty? I have never heard of SFTP.

Posted: Tue Jan 23, 2007 2:22 pm
by Christopher
You can use a free program called WinSCP that works just like your FTP client (maybe better) but does everything over SSH (it uses the Putty libraries I believe). You use it with a shell account rather than a FTP account -- that's the only difference.

PS - if you use the Eclipse IDE you can use the ESFTP plugin to do SFTP from within each project.

Posted: Tue Jan 23, 2007 3:16 pm
by seodevhead
Thanks so much arborint... I'll try to get it working with those.

Is there anyway I can assign both my standard apache user to the directory alongside 'nobody'... so I can both use php as owner and apache? I am under the impression that you can only have one owner.. is that correct?