星期五, 4月 14, 2006

Mac OSX (not server) share any folder

We've had the ability to create share points when using personal file sharing for quite some time. Simply click a folder and select File -> Sharing, set your options, and go. With OS X, that functionality seems to have disappeared. According to Apple, we need OS X Server for this, but that is not so. Here's how you can create your very own share points in Mac OS X:
Open NetInfo Manager and authenticate.

Create a new subdirectory in /config/SharePoints/ (click on config, then on SharePoints, then select Directory -> New Subdirectory).

Set the name value to be what you'd like the share to be called (double-click on the Value column next to name).

Add a new property (Directory -> New Properyt) and name it directory_path.

Add a new value for directory_path. The value needs to be the path of the folder or volume (for example, /Users/username/Pictures).

Save your changes in NetInfo.

In the Finder, set the privileges on the folder or volume you'll be sharing. Do Show Info, then Privileges, and pick what you like -- Drop Box, Read Only, etc.

Stop and restart the AFP Server from the Sharing preferences panel.

Connect from a client and they will see the new share.
Notes: Users with admin privledges may not see the new share point, since they can see all volumes from the top anyway. Also, if you share items with spaces anywhere in the path, do not quote or otherwise escape the spaces when you add the directory_path into netinfo. If the volume being shared is read only (a CD ROM, for example), then just skip step seven. [Editor's note: This is probably the most useful tip I've seen in quite a while! I just tried it, and it worked exactly as described - my "Pictures" folder became available as a read-only volume to the AppleShare network - slick!. I wonder how difficult it is to wrap a GUI application around updating NetInfo?? That would be a killer OS X app!]

補充:用此方法雖然可以成功的 share 我想要的 folder,但是需要用 admin 登入才看得到。

沒有留言: