Home Tips and Instructions Mac OS X File Sharing From Additional Hard Drives and Other Resources Outside of Your Home Folder on Mac OS X 10.4 Tiger
File Sharing From Additional Hard Drives and Other Resources Outside of Your Home Folder on Mac OS X 10.4 Tiger PDF Print E-mail

Up to this point we have only configured your Mac to share your home folder. Now let's take a look at how to share a additional hard drive (either internal or external) or any other devices connected to your Mac! While you can share out each drive / device in your system separately, there's an easier solution. You can simply share out your /Volumes folder, which has links to every volume currently mounted on your machine. This means that even if you later attach a new external hard disk or other device, the new mount will appear in the volumes share, and be available to other users. To do so you will need to modify your Samba configuration file which is named smb.conf and is located in /Private/etc/.

To create a new share, first disable Windows Sharing by opening System Preferences -> Sharing -> Services. Once on this preference pane, make sure the Windows Sharing service is unchecked and then close System Preferences. Windows Services should be disabled before you edit the necessary configuration file. The next step, then, is to make a backup copy of your smb.conf file before  making any changes to it!

To do so:

1. Open Terminal (Applications -> Utilities -> Terminal)

2. Once it's open you'll need to change to the /Private/etc directory by typing:

cd /Private/etc


3. Now type ls to list all of the files in this directory. You should see smb.conf. If you do then you are ready to make a backup of it.

*Note: Because this folder  and the files in it are owned by root, you must have root permissions to make a backup. (This is because we are going to put the backup file in the same folder.) If the account you are logged in under is not an administrator account you will need to first change to an administrative account by doing the following:

At the command line type:
su  name_of_administator_account
For example:

If  there is an administrator account named bob you would type: su bob

You will then be prompted for the administrator's password. Type it and press enter.


4. Once you are an administrator type the following at the command prompt:

sudo cp smb.conf smb.conf.original


(This will make a backup/copy of smb.conf named smb.conf.original and put it in the same directory as the original. This is always a good idea when working with configuration files! Also note that the sudo command temporarily gives you root permissions. )

5. Check to see if the backup has been made correctly by entering the ls command again and look for a file named smb.conf.original. If it's there, you've successfully created the backup and now you can begin making changes to the smb.conf file without worrying about destroying the original.

6. Now you are ready to open smb.conf using nano (a command line text / file editor).  At the command line type:

sudo nano smb.conf

7. Enter your password if prompted to do so.

8. First, we are going to make sure that your new share is secure. So locate / find the [globals] section and add the following line: 

security = user

This option security, if set to user, specifies that a client must first log-on with a valid username and password, or the connection will be refused. *Note: Even without adding security = user this was the default behavior on the OS X 10.4.11 machine I tested Windows File Sharing on, but it is a good idea to add it anyway!) (security = share does not require that the remote user have a local account.

9. Now move down to the very bottom of the file by holding down Ctrl+V or by using the down arrow key on your keyboard and give yourself a blank line or two. Then enter the following text exactly as shown:

[volumes]
comment = All Mounted Devices
path = /Volumes
browseable = yes
read only = no


10.  To save your changes press Ctrl+o and thes press Enter.

11. Exit nano by pressing Ctrl+x.

12. Having written a new smb.conf, it is useful to test it to verify its correctness. You can test the correctness of a smb.conf file , using the 'testparm' utility (man page: testparm). In Terminal type:

testparm

If testparm reports no problems, smbd will correctly load the configuration file and you can go ahead and quit out of Terminal.

13. Now all you need to do is re-enable Windows Services by opening System Preferences -> Sharing -> Services. Re-check the Windows Sharing service and you're done!