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 > Writing Files to Mac thru SMB or FTP - can't read

Writing Files to Mac thru SMB or FTP - can't read
Thread Tools
Dedicated MacNNer
Join Date: May 2001
Location: Atlanta, GA
Status: Offline
Reply With Quote
Feb 17, 2003, 01:51 PM
 
I currently have windows file sharing enables on my mac, and can read and see all the folders from my windows machine. However, let's say I try to copy a picture over to my sites folder on my mac, or even ftp it over. For some reason then, I can't access it from the web (have personal web sharing enabled as well). I get the...

Forbidden
You don't have permission to access /~xxxxx/images/ebay/320-0469.jpg on this server.


--------------------------------------------------------------------------------

Apache/1.3.27 Server at xxxxxxxxxxx.local Port 80


What's going on that no matter what kind of file, or in what folder within my sites folder, whether I copy it over via smb, or via ftp, I can't ever access it via personal web sharing.

Can anyone give me an idea why not?

I can only seem to access it if I mount a shared windows folder on my mac desktop, and copy it over by dragging it into my sites folder on the mac. Then it works, but it never works when the copy is initiated on the windows machine.

If someone could shed some light on this I'd love them.
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Feb 17, 2003, 02:24 PM
 
This just means that the file permission defaults are wrong on this folder. Select the folder in question in the finder, get info (Apple-i), and in the Ownership & Permissions section set the Others to be able to read. Then Click on "Apply to Enclosed".

This should work on an ongoing basis... but I could see cases where adding a new folder would change that.
     
Dedicated MacNNer
Join Date: May 2001
Location: Atlanta, GA
Status: Offline
Reply With Quote
Feb 17, 2003, 02:49 PM
 
Originally posted by larkost:
This just means that the file permission defaults are wrong on this folder. Select the folder in question in the finder, get info (Apple-i), and in the Ownership & Permissions section set the Others to be able to read. Then Click on "Apply to Enclosed".

This should work on an ongoing basis... but I could see cases where adding a new folder would change that.

Well, I try that, and see that the folder was already set for others to read and write. However, I go to get info on the particular file that I transfered over, and the "Others" section is just grayed out. The only ones I can change are the two other ones. I try reapplying to the whole folder, but doesn't change it. So it seems that when it's written from the windows machine it just doesn't allow that "Others" option to even come into play. There's gotta be a fix for this, right?
     
Dedicated MacNNer
Join Date: May 2001
Location: Atlanta, GA
Status: Offline
Reply With Quote
Feb 17, 2003, 03:02 PM
 
Ok, so if I go into the root user the Others is now an available option, as well as if I change the Owner to myself. So, I understand why this is happening, however anytime a new file is written to that folder, it's default permission for Others is "No Access." Is there a way to change what the Others default permission will be when a file is written. It sorta defeats the purpose of writing the file from my windows machine in the first place if I have to go back to the mac, and set all the permissions for the files I transfered over.
     
Dedicated MacNNer
Join Date: May 2001
Location: Atlanta, GA
Status: Offline
Reply With Quote
Feb 17, 2003, 10:07 PM
 
Originally posted by GetSome681:
Ok, so if I go into the root user the Others is now an available option, as well as if I change the Owner to myself. So, I understand why this is happening, however anytime a new file is written to that folder, it's default permission for Others is "No Access." Is there a way to change what the Others default permission will be when a file is written. It sorta defeats the purpose of writing the file from my windows machine in the first place if I have to go back to the mac, and set all the permissions for the files I transfered over.
someone want to help me?
     
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Feb 17, 2003, 11:29 PM
 
I think there might be a way to change the default permissions but I don't know what it is.

One solution might be to have a shell script run once an hour via cron which will change the permissions of everything in the directory so that others can read it.

This keeps your stuff, at most, an hour behind. However, you probably want to work and see how it's going at the same time, so this isn't a viable solution.

Another method is to get a SSH client for your Windows box and SSH into your OS X box and change the permissions via the command line. This is the easiest solution and you don't have to go to the OS X box to do it. You can take care of it from the Windows Box.

If you're interested in either of these let me know. I will further explain whichever you like.
     
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Feb 18, 2003, 12:05 PM
 
I e-mailed this to the original poster. I'm posting it here in case others might want the info (or correct me if I made an error).

Hi, this is Xeo from MacNN.

Well, a shell script that runs every hour would be fairly simple. However, there really is no need for a shell script now that I think about it, so you only need cron itself. Also, SSHing to your OS X box would be simple. It all depends on what you want to do.

Using cron:
Open Terminal.app and type:

# sudo pico /etc/crontab

It will ask for your password and you should enter it. At the bottom of the file, it has number separated by tabs, then "root" then a command. That's the format we will need. So at the bottom, type:

0 * * * * root chmod -R 755 /path/to/directory

Note that there are tabs between everything except the "chmod" command. So what does that mean? Well, it means on the 0 minute of every (*) hour, of every (*) day, of every (*) month, of every (*) weekday, root will run the chmod command. This is pretty powerful syntax. You could make it run at 2:01 every day, or every two hours every day, or every fifth minute of every two hours. it all depends on how often. I assume that once per hour is enough. You can do it up to once per minute, but then you have to realize that this command is run every single minute which is most likely overkill. It will keep your stuff updated to within the minute, though.

Also, make sure you type the path to the directory you want the permissions to be fixed. If it has spaces, put quotes around the path like: chmod -R 755 "/path/to/directory with spaces".

Type Control-X, then it will ask if you want to save and just type "Y" for yes and Return.

SSHing from your Windows box:
First, you need a SSH client for windows. I don't know of one off hand but I know they exist. I suggest searching download.com or tucows.com for "SSH client" and see what comes up. Then, on your OS X box, go to System Preferences > Sharing, and turn on Remote Login. This will start SSH. Now, back to your windows box, you'll need a few key pieces of information. You will need the IP of your OS X box, your short username, and the password. Once you're logged in you should be at a command prompt, just like in Terminal.app. You can do all the same things. The command you'll want to run is:

# sudo chmod -R 755 /path/to/directory

It will ask for your password and you should enter it. That will fix the permissions right then and there. The "sudo" part of these commands is you're running the "chmod" or "pico" commands as root. You need the extra privileges of root in most cases when changing permissions or editing system files.

Hope this helps. I will post this to the MacNN board as well in case others could use the info.
     
   
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 07:21 AM.
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