Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > ftpd, umask - Directories and files

ftpd, umask - Directories and files
Thread Tools
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Mar 4, 2003, 07:17 PM
 
Hi,

I have a box running 10.2.4 client.

I have several web sites running on it.

I would like one of the users on the machine to be able to edit his pages through FTP.

I did some experimentation and discovered that when he uploaded files and directories they had the wrong permissions and could not be seen.

I read an article about uMask on Mac OS X Hints that said that I could change the default permissions in the ftpd.conf file.

so now my ftd.conf file reads:

umask all 022

now the uploaded directories have the right permissions - but the files do not - they are still not readable by anyone.

what am I doing wrong / missing?

thanks

     
Grizzled Veteran
Join Date: Nov 2001
Location: Oregon
Status: Offline
Reply With Quote
Mar 6, 2003, 03:04 AM
 
Actually, the files in the screenshot are all world readable (r). The directories are readable and excutable (x), which is generally what you want for directories.

But i'd suggest an entirely different approach. FTP is a big security hole since passwords are sent in the clear (and can easily be observed by a packet sniffer). It wouldn't take much for someone to hack into any account with FTP access enabled.

A smarter approach is to enable remote logins via ssh. Updates could then be done via FTP inside an ssh tunnel, or via SFTP. If this user is using a UNIX box, then rsync would be a perfect solution (much better than FTP) as it can mirror a local copy of an entire web site onto a server, updating any files which have changed, and deleting any files which have been deleted on the master. It can also set permissions and ownership. Combine that with public key pair authorization and a cron job, and it can all happen automagically (for more info on this, see the rsync, ssh thread).

FYI: You can also set permissions for all files within a folder with a couple commands like this (and it would be a good idea to include it in the upload script to ensure proper permissions):
Code:
sudo chmod -PR u=rw,g=r,o= /path/to/web/root chmod -PR ug+X,o= /path/to/web/root
I'm planning on writing a GUI front end to rsync to do all this.
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Mar 6, 2003, 05:54 AM
 
Thanks for the info - I was getting a bit confused between world readable and Executable.

Good luck with the rSync GUI - sounds very useful.

I'm off to that thread now...
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 05:51 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2