File Sharing in OSX

Soldato
Joined
9 May 2005
Posts
4,530
Location
Nottingham
Basically I enabled 'Windows Sharing' like the apple help instructed me to, I can acess my user directory from my Windows XP machine fine. However the directory is open for full read and write access, which I obviously don't want enabled if I'm connecting it to a network.

How do I unshare my user directory and only share certain folders with read-only premission. I'm assuming this can be done and isn't like the FTP issue where OSX simply doesn't have this feature. I don't really want to have to install something like SAMBA just to share a folder on a network.

Sorry for all these questions but as I'm starting to use my MacBook at lot more. Switching from Windows there are abviosuly different ways to do a lot of common tasks I'm used to in Windows.
 
I tend to use samba and edit the smb.conf to my needs. For example, here is the file which allows me to share my own accounts 'shared' folder and the 'incoming' folder for all users.

[global]
guest account = unknown
encrypt passwords = true
auth methods = guest opendirectory
passdb backend = opendirectorysam guest
printer admin = @admin, @staff
server string = iMac G5
unix charset = UTF-8-MAC
display charset = UTF-8-MAC
dos charset = 437
use spnego = yes
client ntlmv2 auth = no
security = user
os level = 8
defer sharing violations = no
vfs objects = darwin_acls
brlm = yes
workgroup = HOMENET
hosts allow = 192.168.0.10
domain master = no
; preferred master = yes
local master = no

;[homes]
; comment = User Home Directories
; browseable = no
; read only = no

[Shared]
comment = Andys Shared
path = /Users/andy/Shared
browsable = yes
read only = no
guest ok = no

[Incoming]
comment = iMac Incoming
path = /Users/Incoming
browsable = yes
read only = no
guest ok = no

;[public]
; path = /tmp
; public = yes
; only guest = yes
; writable = yes
; printable = no

;Using the Computer Name to compute the NetBIOS name.
;Remove this comment to override
; netbios name = iMacG5

;[printers]
; path = /tmp
; printable = yes


You can find a template at /etc/smb.conf.template

You also need to go to Utilities -> Directory Access, select SMB/CIFS, click Configure and make sure the workgroup is set correctly.

This is the only way I've found to share my choice of directories, rather than just my home dir.


A.
 
Thanks, guess I'm going to have to configure Samba then. I was hoping there would be an easier way but I guess not. I mean filesharing isn't the easiest thing in Windows but at least you don't need to go and edit a configuration file to share a directory. OSX has a lot of useful features but does lack some of the ones you expect exist, just found out that "cut" doesn't seem to exist either in OSX.

Update: I opened a terminal and tried to copy the new config file over the old one and it says "permission denied". I'm assuming it doesn't like me playing with the system files. How do I overwrite the file?
 
Last edited:
You need to use superuser temporarily. I edit using pico and call it with the line...

sudo pico -w /etc/smb.conf

You'll be asked to enter the admin password.

You can create the shares using the Netinfo Manager in Utilities, but I'm not sure how!

Edit: This hint may help.


A.
 
You need a password to login and access it so why do you need to set permissions!? :confused:

Mine is enabled on a network, wireless too and I dont have a problem with it.. :p
 
Sorted it, OSX was being weird last night and wouldn't let me login as root. I just did sudo su and overwrote the smb.conf with my new version and it seems to work fine now.
 
Back
Top Bottom