0

Possible Duplicate:
How to set up default group permission in linux folder

I'm uploading to /var/www via SFTP and wondered how I can get it so when I upload a file or folder it always has the owner and group as www, and have the default chmod as 770.

I have tried this so far,

chmod 770 /var/www -R

chown www:www /var/www -R

and I have also tried

chmod u+s www -R

Currently when I upload a file the owner is the user I'm logged into and group www and chmod is 644.

anyone know how to help?

1 Answers1

1

The owner of the files you upload over sftp must be the user you are using to do the upload. The resulting permissions as they land on the directory depend on the umask setting. Check it out at:

http://en.wikipedia.org/wiki/Umask

If you want to keep permissions, timestamps, etc on the "other end" you can use a parameter; in scp it's -p:

-p      Preserves modification times, access times, and modes from the
        original file.