Koozali.org: home of the SME Server

User webpages , new files always set to 660, please help

oseano

User webpages , new files always set to 660, please help
« on: October 20, 2004, 11:56:32 AM »
Dear All,

Users need their personal webspace (like http://domain.com/~users), so I follow the tutorial in this site. I use dungog-proftpd-chroot-0.1-2.noarch.rpm and e-smith-user-webspace-0.1-3.noarch.rpm

The installation is OK, but when the user upload file to their home directory, the files always got the permission 660, so can't access from website (access denied). I have to manually chmod the files to 664 so everybody can access via browser.

How to set the permission to every files uploaded by users automatically set the permission to 664 ?

Thx for help,

Sean

haynest

public_html permissions
« Reply #1 on: October 29, 2004, 12:34:11 PM »
oseano...

We map the public_html folder for the users and the permissions are handled via samba.

http://mirror.contribs.org/smeserver/contribs/thaynes/E-Smith/howto/samba/ has a fragment for the the config that we used last year when we were using SME.

Regards...   Tom

oseano

Re: public_html permissions
« Reply #2 on: October 29, 2004, 01:40:07 PM »
Hi, haynest.......

Thank you for the info.
I already follow the guide from the url, but got the same results.
Any other info ?

Thx,

Sean Oseano

Quote from: "haynest"
oseano...

We map the public_html folder for the users and the permissions are handled via samba.

http://mirror.contribs.org/smeserver/contribs/thaynes/E-Smith/howto/samba/ has a fragment for the the config that we used last year when we were using SME.

Regards...   Tom

haynest

public_html permissions
« Reply #3 on: October 29, 2004, 03:21:45 PM »
Sean...

Did you install the samba permissions fragment from _my_ URL? I have the fragment posted there that we used in addition to the standard instructions in order for it to work with the mapped drives here on our campus.

If your users author via ftp, then you have another fragment to attend to.

This one works with samba if that is how you are using it.

Regards...   Tom

oseano

User webpages , new files always set to 660, please help
« Reply #4 on: November 02, 2004, 05:57:12 AM »
Dear haynest,

Yes, The user using ftp to login to the server. Some from internal network and others from external. Could you please guide me to the other fragment for the ftp ?

Thx,

Sean Oseano

haynest

User webpages , new files always set to 660, please help
« Reply #5 on: November 05, 2004, 03:48:14 AM »
Sean...

I don't currently have an SME install to check files.

Maybe there is someone out there who has done this already and has a working fragment to change the userdir permissions when users write via ftp.

Regards...   Tom

oseano

User webpages , new files always set to 660, please help
« Reply #6 on: November 05, 2004, 05:30:41 AM »
Tom,

Apreciate for the info.
Anyone can help me ?
Please...

Thx

Sean Oseano

Quote from: "haynest"
Sean...

I don't currently have an SME install to check files.

Maybe there is someone out there who has done this already and has a working fragment to change the userdir permissions when users write via ftp.

Regards...   Tom

haynest

ftp permissions
« Reply #7 on: November 06, 2004, 10:29:33 PM »
Does anyone have some help for Sean?

I may be able to install SME on a spare machine if it comes to that, but there has to be someone who has dealt with this before.

oseano

Re: ftp permissions
« Reply #8 on: November 08, 2004, 02:02:30 AM »
Hi, haynest

Big thax for that Buddy.
I really need this solutions, coz our users need to upload files via ftp to their home directory and can be access from website.

Anyone that already done this in SME 6.01, I really need your help.

Thx,

Sean Oseano

Quote from: "haynest"
Does anyone have some help for Sean?

I may be able to install SME on a spare machine if it comes to that, but there has to be someone who has dealt with this before.

haynest

ftp userdir permissions
« Reply #9 on: November 08, 2004, 03:09:57 AM »
Sean...

Take the zip file at and unzip it.

http://academies.culver.org/proftpd.conf.zip

Move it to /etc/e-smith/templates-custom/etc with WinSCP or similar

/sbin/e-smith/expand-template /etc/proftpd.conf

Restart your server (or just proftpd).

New files created via ftp in the home directory will be 755 permissions on the directories and 644 on the files.

Enjoy...   Tom

oseano

User webpages , new files always set to 660, please help
« Reply #10 on: November 08, 2004, 06:20:59 AM »
Hi, haynest.

Thx for the files, follow your instruction.
Try to conect using ftp client, create directory, but now I got 770 instead of 664.
upload files got 660 instead of 755.

Any suggestion ?

Anyway, Thx foe help me,

Sean

haynest

ftp userdir permissions
« Reply #11 on: November 08, 2004, 10:56:34 AM »
Sean...

If you got 770 for an uploaded directory after the changes, that sounds like a umask of 007. You want 755 on the uploaded directories in public_html.

Likewise the uploaded file with 660 permissions is a umask of 007. You want 644 on the uploaded files for the public_html folder.

The 007 is the old umask prior to the changes.

Did you expand the template?

Did you restart proftpd?

If you check in /etc/proftpd.conf after expanding the template, you should have the following in one section.

<Directory ~/home>
    AllowOverwrite on
    Umask 022
    <Limit WRITE>
        AllowAll
    </Limit>
</Directory>

To expand the template, run

"/sbin/e-smith/expand-template /etc/proftpd.conf" from the command line with no quotation marks. It is possible to cut and paste the command into WinSCP or PuTTY without retyping it.

The changes will only affect the permissions on files created after the template is expanded and the proftpd is restarted.

Regards...   Tom

oseano

User webpages , new files always set to 660, please help
« Reply #12 on: November 08, 2004, 12:16:56 PM »
Thx Tom for reply.

I download the script and then using winscp copying 30UserDirAccess to /etc/e-smith/templates-custom/etc
From comand line I expand the template using
"/sbin/e-smith/expand-template /etc/proftpd.conf"

After that restart the server.
And from /etc/proftpd.conf , I got :

<Directory ~/home>
    AllowOverwrite on
    Umask 007
    <Limit WRITE>
        AllowAll
    </Limit>
</Directory>

Should be Umask 022, but I got Umask 007.
I use dungog proftpd which I download from
http://www.dungog.net/sme/files/dungog-proftpd-chroot-0.1-5.noarch.rpm

Sean OSeano

haynest

ftp userdir permissions
« Reply #13 on: November 08, 2004, 12:37:26 PM »
The entire proftpd.conf directory in the zip file needs to go in /etc/e-smith/templates-custom/etc

Then expand and restart.

For the time being as a temporary thing you could change the proftpd.conf in /etc directly and restart the service.

I have never used the dungog proftp...

oseano

User webpages , new files always set to 660, please help
« Reply #14 on: November 08, 2004, 01:04:37 PM »
Hi, Tom

Problem solved, thank you very very much.

I make big mistake by copying
30UserDirAccess to /etc/e-smith/templates-custom/etc
should be copying to:
/etc/e-smith/templates-custom/etc/proftpd.conf

again thank you very much for help. I really appreciate what you've done for me.

Really nice community, where everyone helping each others.

Have a nice day,

Sean Oseano