Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Sharing files between Macs and PCs with Samba Apps
Samba is a free UNIX program which lets you specify any number of 'shares' which will be visible to PC users on your network. Think of it as a PC/Mac version of Mac OS 9's file sharing. It's a great way to move files back and forth between the two types of machines, and it's actually (somewhat) straightforward to install and configure.

If you're interested in Samba on OS X, read the rest of this article for step-by-step instructions. I wrote it to be as simple to follow as possible, as I had zero UNIX experience the first time I installed it. Please post any questions or comments regarding the installation/configuration process, and I'll try my best to address them.

If you have minimal UNIX experience, installing and configuring Samba can be a bit intimidating, to say the least. As a friend of mine said, "Samba configuration is definitely a black art!" However, using a web-based admin tool, and if your network is relatively simple and your needs basic, it's actually somewhat easy. Here are the steps involved.
  1. Download the Samba installation package from one of these URLs:

    Samba #1
    Samba #2
    Samba #3

    [NOTE: Please check the xamba website to make sure you're getting the latest version of the program; the above link was current at the time of this posting, and downloads version 2.0. There may be newer releases, so check first...]

  2. Decompress the downloaded file, and then launch the resulting Apple installer. Follow the instructions (click the lock and enter your admin password to start), and Samba and SWAT (see below) will install themselves.

  3. Once Samba has been installed, the fun begins - configuring it. The easiest way to configure Samba (for most non-UNIX-wizards) is through SWAT, an included web-based GUI configuration tool. SWAT starts a mini-web-server on your machine, running on port 901. Connect to this server in your browser with this URL: http://127.0.0.1:901. You should be presented with a login dialog box. It is very important that you set the username to root and enter your root password. You should see a screen with a control panel that looks like this:


  4. Click on the Globals button, and don't be intimidated by the resulting screen of settings! We're only going to change a few variables, which I'll refer to with BOLD CAPS in the following steps.

  5. It's preferable if you set the WORKGROUP variable in the Base Options to match your existing Windows workgroup name. It's not required, but I was told it eliminates one potential trouble spot.

  6. Set the pop-up menu item for SECURITY in the Security Options section to SHARE.

  7. Change the ENCRYPT PASSWORDS option to YES, in the same section. Later, we'll set up a Samba user that understands Windows encryption.

  8. If you want to restrict access to your Samba shares, you can enter a value in the HOSTS ALLOW variable. In my case, I have it set to "192.168.1.", so that any machine on my internal network can see the share, but nobody from outside would be able to do so.

  9. Once you've set everything, hit the COMMIT CHANGES button at the top of the screen, and click on the Password icon.

  10. We now need to have Samba create a user that will be able to 'speak' Windows encryption. Samba will not let you create a user that does not already exist locally, so you'll want to enter your OS X username on the first line in the "Server Password Management" section. You can then enter any password on the next line, and repeat it on the third line. Click on Add New User when you're done. You should see a small message that reads "Added user username" in the middle of the screen.

  11. We have now configured the server, and established a user, but there's nothing yet to share. So click on the Shares navigation button.

  12. Type a new share name into the input box, and click on the Create Share button. The name you give the share is the folder name (inside your machine name) that Windows users will see when they connect to your OS X box.

  13. In the PATH variable, enter the path to the item you'd like to share. In my case, it's a downloads folder in my user directory, so I entered "/Users/robg/Documents/downloads".

  14. In the security section, make sure the guest account is disabled by setting GUEST OK to "no." Unless, of course, you wish to allow guest access.

  15. Once you have your share set the way you want it, click the Commit Changes button.
Believe it or not, you're done! If you're truly paranoid, you could hit the Status button, and then the two Restart buttons on the status screen, but this shouldn't be necessary. If you switch to your Windows box, you should be able to see and connect to the share you created. NOTE: At least in Windows98, there's no way to enter a username when connecting to the share, just a password. You'll need to login to your PC (under the Windows Networking protocol) using the same username you use in OS X and Samba. You do not need a password at startup, just the username.

These steps should work to get you up and running with Samba on OS X. Please let me know if you have any problems with the steps as described here. There's also a MacNN Samba forum with tons of detail, and of course, the Samba web site.

Thanks to Derk-Jan Hartmann for compiling the application, and writing the first how-to that got me started, and to my UNIX-wizard friends for further debugging help.
    •    
  • Currently 2.17 / 5
  You rated: 5 / 5 (6 votes cast)
 
[29,434 views]  

Sharing files between Macs and PCs with Samba | 29 comments | Create New Account
Click here to return to the 'Sharing files between Macs and PCs with Samba' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
SAMBA can be nasty... beware
Authored by: tapella on Mar 28, '01 11:35:09AM

SAMBA is a bit dangerous to install if you aren't familiar with it... not to your own computer, but to the Windows network. I'm not sure if all the bugs have been fixed or not, but it's really easy for a Unix machine running SAMBA to become a local controller computer and "take over" the Windows network. This tends to lead to mass chaos for IT departments who are wondering what's going on with their network. At my company the IT guys freak out when someone installs SAMBA because they've experienced first-hand the damage it can cause (it took a long time to fix the Windows network...).

Anyway, just a warning to be careful!



[ Reply to This | # ]
SAMBA can be nasty... beware
Authored by: khaled on Apr 20, '01 10:26:26AM

Hi,

I really like your tuotrial and I wanted to try iy, but I can't get the Samba distribution from the link you provided. Would you be kind enough to correct the link ? please...

Thanks.



[ Reply to This | # ]
SAMBA can be nasty... beware
Authored by: dcochran on Feb 05, '02 05:14:53PM

Is there a way to guard against the nastiness?? I don't want to create trouble for my IT gang, but I do need to share files between my ibook and my pc. And because our network is novell netware without Apple support . . . I believe this is my only (free) option.



[ Reply to This | # ]
File sharing without installing SAMBA
Authored by: wankomatic2000 on Feb 26, '02 11:03:57PM

If you just want to get files off your iBook and onto your PC you don't need to install SAMBA.

SAMBA will allow you to pull files from your iBook while sitting at your PC. You can achieve the same result by sharing a folder on your PC (assuming that File and Printer Sharing for Microsoft Networks is installed).

1. Share a folder on your PC. Make sure the permissions will allow you to write to it from another computer on the network.

2. Open the Finder on your Mac.

3. Hit Command-K. A "Connect to Server" dialog will appear.

4. In the "Address:" text box, type in the Windows Networking name of your PC and the folder that you've shared; it should look something like this when you're finished:

smb://myPeeCeeName/MySharedFolder

5. Type in your Workgroup or domain name, your user name and password.

That's it.

If everything went right, you'll have a new drive at the top level of your Finder window. From your Finder, you can drag and drop files to copy them onto your PC.



[ Reply to This | # ]
File sharing without installing SAMBA
Authored by: pfurbacher on Jun 03, '02 07:41:52PM
This standard set of instructions has never worked for me.
Nothing I do allows me to see shared drives or folders
on my Win 2K box from this Powerbook which is running
Samba. I can see all my OS X shares from the Win 2K box,
but smb://PeeCeeName[or IP address]/SharedFolderOrDiskName
emphatically does not work.

I always get a "server returned error 1" message.

Do these instructions assume that the Windows box is
running Windows Server? Any other assumptions
besides having "File Sharing for Microsoft Network"
on?

Thanks.





[ Reply to This | # ]
File sharing without installing SAMBA
Authored by: pfurbacher on Jun 12, '02 03:30:29PM

Well, to answer my own post, it appears that there are
two things one should avoid in order to get the Command-K
"Connect to server..." to work:

1. Avoid characters such as hyphens in the Windows computer's name.
(Silly me.)

2. IP addresses, as in "smb://172.16.1.1/<share_name>"
simply do not seem to work. (Someone else has pointed
this out in another OS X Hints thread.)

Can't wait for Jaguar's "Rendevous" (ZeroConf), though.



[ Reply to This | # ]
Windows Networking is not easy...beware
Authored by: wankomatic2000 on Feb 26, '02 10:42:38PM

SAMBA is not nasty. People who don't know how to install SAMBA and then blame SAMBA are nasty. ;)

Saying that SAMBA causes damage is misleading. SAMBA will not damage Windows networks, but it can confuse other clients and servers on the network.

Let me say this again, because it's really important: SAMBA will not cause damage to your Windows computers. Unless you've got a Primary domain controller sitting at home, and other machines relying on it for log-on services, SAMBA (even if it is misconfigured) will not cause your PC's to quit communicating, and in no case will it ever cause damage to your other computers.

Home users don't have anything to worry about. Even if SAMBA is configured to be the primary domain controller of MYWINDOWSDOMAIN, your Windows PeeCees are in Workgroup mode, which means they're not looking for a domain controller anyway.
If you're going to be bringing your Mac to work and plug in to the Windows domain, make sure that you don't set it up to be the domain controller. If you're plugging into the network at work, you should probably take more time to understand Windows Networking anyway, and make sure your network admin knows that you're plugging your own machine in anyway.

If you need to install SAMBA, understand how Windows Networking works.

SAMBA is an excellent resource that can make life a lot easier, but just like any powerful tool, if used the wrong way, it can cause some headaches.



[ Reply to This | # ]
New link location
Authored by: vissering on Apr 21, '01 08:15:00PM
The link seems to have moved. Go to http://xamba.sourceforge.net and follow the link to Samba X for more information.

[ Reply to This | # ]
401 Bad Authorization ?!
Authored by: JugheadsRevenge on May 22, '01 09:11:54PM

I installed SAMBA and tried to follow the link but as soon as I log-in as "root" and my password, I get "401 Bad Authorization." Did I do something wrong?

Jorge



[ Reply to This | # ]
401 Bad Authorization ?!
Authored by: a27x64sy on May 16, '02 08:43:48PM
This will happen if the root account is not enabled on your machine (it is not by default). Here is a post that explains how to enable root http://www.macosxhints.com/article.php?story=20010324095804436 hope this helps

[ Reply to This | # ]
encrypt passwords
Authored by: robbchar on Jun 21, '01 02:42:59PM

I just installed SAMBA using these directions. It wasn't working at all until I choose 'encrypt passwords' for WIN2000. Otherwise, everything else worked fine.

robb



[ Reply to This | # ]
proxy plus
Authored by: antinous on Nov 16, '01 04:52:18PM

Hi
I've installed Samba and when I try to access the url to configurate Samba with Swat I've got an error message. According to the message this is due to Proxy plus, a freeware that I use to share my Internet connection between my PC and my Imac, on my PC . Indeed my Pc is the "master "of my small network since the drivers of my adsl modem don't exist on mac os X yet.
But maybe I mistake me because I've installed samba but when I want to open it i can't find any file refering to samba except a folder where there are two text files...
Maybe it's normal maybe not..
can someone help me?
you can answer to me by email : antinous02@infonie.fr
thanks



[ Reply to This | # ]
server password management
Authored by: tregan on Dec 03, '01 11:51:51AM

I am trying to enter a server user name and password but I get the following error:

The attempt to load 'Accessing URL: http://127.0.0.1:901' failed

Any suggestions?



[ Reply to This | # ]
server password management
Authored by: Voyager_2 on Jan 01, '02 11:01:44PM

me too

why is this happening?



[ Reply to This | # ]
server password management
Authored by: dcochran on Feb 05, '02 05:18:29PM

Same problem here. Slight emendation to the message:

The attempt to load 'Accessing URL: http://127.0.0.1:901/passwd' failed.

It won't accept any username (including root) or password. Same message every time. I've double-checked all my previous steps . . . At least I've tried to.



[ Reply to This | # ]
server password management
Authored by: daveymcg99 on Feb 25, '02 10:52:24PM

I too get this error! Any help would be appriciated!



[ Reply to This | # ]
server password management
Authored by: bq on Apr 03, '02 12:56:43PM

Yay! I get the very same thing. So, it's a bug. Anybody know what gives?


bq



[ Reply to This | # ]
server password management
Authored by: tcrider on Aug 20, '02 04:31:06PM

Same thing Here! Does any one know what is going on with this!



[ Reply to This | # ]
server password management
Authored by: aris_filippas on Jan 24, '04 05:27:25AM

Open the 901 port in the firewall



[ Reply to This | # ]
server password management
Authored by: Veronica on Feb 23, '06 05:02:53AM

What are you saying ? Are you stupid ?



[ Reply to This | # ]
Server Password management solution
Authored by: bmeteor on Mar 16, '02 02:01:13AM
sudo smbpasswd -a username

This will add a user so Windows can log in. Enter your username in place of username.

For further reference, It's on the Xamba site at http://xamba.sourceforge.net/sambax/index.shtml at the bottom of the page.

Call me dense, but it took me forever to find this little detail, so I'm just trying to help out. :-)

[ Reply to This | # ]
Server Password management solution
Authored by: filipp on Apr 14, '03 06:46:47AM
That didn't work for me. However, adding "local master = yes" in /etc/smbd.conf did. ... just my three cents.

[ Reply to This | # ]
More help here, for basic users.
Authored by: luis123 on Apr 15, '02 01:07:32AM

Hi.

I had a hard time configuring Win 98 to work with this thing.
This web page helped me a lot:

http://ieee.uwaterloo.ca/UsingSamba/

Thanks.

Jesus is Lord.



[ Reply to This | # ]
loading 127.0.0.1/passwd page
Authored by: intrntmn on May 02, '02 10:30:40PM
I have found a solution to the problem perplexing most of us in installing samba. The solution is relatively easy.

The reason the passwd page does not load is because the actual password file which holds the user lists is not created by the packaged installer.

To set this up, merely open a terminal window and type the following:


sudo touch /usr/local/samba/private/smbpasswd


Enter your root password (if prompted) and all should be well.

I hope this helps!

Jack
intrntmn

[ Reply to This | # ]
sorry but
Authored by: macubergeek on Jun 02, '02 07:36:47PM

your hint dosn't work
swat simply refuses to launch
Samba and swat is a wretched piece of work



[ Reply to This | # ]
sorry but
Authored by: tcrider on Aug 20, '02 04:42:42PM

He's right! tried the tip too! does not work?



[ Reply to This | # ]
Article updated...
Authored by: robg on Jun 12, '02 11:11:19AM
I have clarified the info on password encryption, thanks to an email from Paul F., who explained exactly how password encryption has evolved in the Windows world:
The evolution of encrypted passwords on Windows has been from un-encrypted (Win 3.11, Win 95 before the SMB Update, WinNT4 before SP 3) to encrypted (WinNT 4.0 SP 3 and greater, Win2K, Win XP). Unless the user goes into the registry and alters the UsePlainTextPasswords setting (NOT advised!), encrypted passwords are a must. Hence, for all current versions of Windows, one MUST set "encrypt passwords" to YES.
I also added a blurb about checking for the most recent version of Samba, and generally cleaned up the formatting a bit. Thanks, Paul, for the Windows encryption info! -rob.

[ Reply to This | # ]
Problem with Samba 2.2.2
Authored by: Tsabo on Aug 21, '02 02:06:14PM

Hey i was wondering why the SWAT i was using only showed up with a control strip limited to HOME, STATUS, VIEW, and PASSWORD. It had only those on the strip and i was wondering if there was another way to edit the global options through these or if they just decided not to let the people edit these options anymore. Thanks for the help.

Thomas



[ Reply to This | # ]
Problem with Samba 2.2.2
Authored by: gjm25 on Aug 22, '02 11:49:24AM

Hi Thomas,

I had the same problem, and discovered because I was using my admin user and pwd to log into SWAT. You need to log in to SWAT as root in order to change the settings.

Gregor



[ Reply to This | # ]