www.macdevcenter.com/pub/a/mac/2003/03/18/samba.html
The server facilities are provided by a Unix daemon known as Samba. Samba is one of the most successful open source projects around and has been ported to Linux, various BSDs, and Darwin/Mac OS X Started by Andrew Tridgell, the Samba team works to provide as many features of the Windows server products as possible. Currently Samba can provide disk shares, print shares, act as a WINS server, and perform NT4 primary domain controller duties. By default, your computer will be a part of the SMB workgroup "WORKGROUP" and have an SMB hostname that is the same as your computer name. If you want the machine to appear in the Windows Network Neighborhood, you may need to adjust these settings. Consult your Windows documentation to find out what workgroup your Windows machine is using. Once you have it open, authenticate by clicking the padlock in the lower left corner. This will present you with a dialog box that allows you to specify your workgroup. Once you have set it to match your Windows machine, click the 'OK' button. This is all we'll need to set in Directory Access, so go ahead and close it. Here you can specify your computer's name and Rendezvous name. While in the Sharing pane, you should also see a listing of Services available. Samba will start up using the workgroup and hostname you've chosen. To do this, switch to the Accounts pane of System Preferences. If necessary, enter the user's password to enable editing of the user's information. Toward the bottom you'll see a checkbox labeled 'Allow user to log in from Windows'. Since users' home directories are shared by default, enabling this checkbox will allow that user to access his home directory from a Windows machine. The address to do this is \\HOSTNAME\USERNAME, which you would enter in the Windows Explorer. The user should also see his home directory in the Network Neighborhood. Adding More Shares The Mac OS X install of Samba is only configured for home directory shares by default.
This is fine if you only want to share files that are in your home directory, but what if you have some MP3s or AppleWorks documents in another folder? Perhaps you want to allow others to access your /Users/Shared folder from Windows.
section, which lists directives for sharing your users' home directories. In order to demonstrate how to create more disk shares, I'll show you how to share your /Users/Shared folder with Windows users. The first thing to do is to create a backup of your original file. To do this, we're going to go into the command line interface of Mac OS X and use some basic Unix commands. Backing Up Your Samba Configuration Open the Terminal application, located in /Applications/Utilities. Once it's open, enter cd /etc to change to the /etc directory. If you now enter the command ls, you'll see all the files and folders that are in the /etc directory. Because these files are all owned by root, you must have root permissions to make the backup. The sudo command temporarily gives you root permissions.
To move around the file, use the arrow keys on your keyboard. Making changes to the file is very similar to the TextEdit application. The first step to add a new share is to give it a section title. The section title is the same as the actual share's name.
line tells Samba that a new disk share is being defined. The comment line will display the text "Shared Directory" in Windows Explorer. Since we want to be able to save changes to this share's files, we declare it with a read only value of no. The browseable attribute determines whether a share is displayed in the Windows Explorer. Even if you set this to no, it can still be accessed, the user would just have to know the full path to the share (in this case, \\HOSTNAME\SHARED ). The last line, create mode, defines the permissions that files being created on the share will have. In this case, the permissions are read/write/execute for owner and read/execute for group and other. Once you've entered these changes, press Ctrl+O and then enter to save the file, then press Ctrl+X to quit pico. To make Samba aware of the changes, use the command sudo killall -HUP smbd. This will tell the Samba daemon to reload its configuration information. One important thing to remember is that a user must still have a valid account on your machine to access these shares. She must also have the 'Allow user to log in from Windows' option enabled on her account. On a Windows machine, you should now be able to see your "shared" share and a share named with your user's username in the Network Neighborhood. This user titled share contains the user's home directory.
Jobs @ O'Reilly Copyright 2000-2006 O'Reilly Media, Inc. All trademarks and registered trademarks appearing on the O'Reilly Network are the property of their respective owners.
|