Multi-Platform Windows File Sharing in OS X, Part II


Ryan J. Bonnell Skip to comments 8 Comments (Comments Closed Closed)

The second part of our file sharing series covers user accounts, enabling sharing between your machines, and creating SMB shares.

Accounts

In Part I of this three part installment series we gave on overview of the previous ways Macs were able to share files with non-Macs, and a little history into how things have evolved. We didn't touch much on settting things up, but rather more about what you should know before getting things started. This week, we'll discuss setting up User accounts, enabling Windows file sharing, and explaining how important the SMB/CIFS address is in knowing how (and where) to access your Mac.

In Mac OS X, each local user account has both a normal "User Name" and a Unix-style "short name". The full user name can be any mix of alphanumeric characters, including such things as spaces, numbers, accents, and even symbols — similar to the types of characters you can use to uniquely rename your hard drive from the default Macintosh HD. The short name, however, cannot contain spaces or special characters, and is preferred to be eight alphanumeric characters or less.

Even if you try to create a short name using non-acceptable characters, (such as spaces, dashes, special characters, etc...) the Mac will refuse to accept your input. A good practice is to use your Real Name for the full username and your last name (or an abbreviated form) for your short name. Some people go as far as creating unique aliases for their short names, and using that name for both the full usernames and Unix-style short names.

It doesn't matter how you set-up your account, but rather that you know what they are — most of it is purely preference anyway. Now that you know the two styles of usernames you have, let's talk about how and when you should use them.

Using your Accounts

Having two usernames is confusing for some, and easy for others. The problem of having both a full username and short name doesn't manifest itself until you're prompted for the one you're not familiar with.

A classic example is when an authentication prompt asks for your password and automatically suggests your short name when you're more familiar using your full user name. In most cases both will work, but for some it's just too confusing knowing which one they should use and when.

The full username or short name can be used interchangeably in almost all contexts of local machine operations, but there are a few exceptions. You can use either your full username or short name for such things as:

There are times however when can't use your full username and instead need to use your Unix-style "short name". Why does anything of this matter?

It matters because you as a user need to understand when it's applicable to provide the correct one. If you're trying to access another Mac from your Mac, then it's perfectly acceptable to user either your full username or your short name. If you're trying to access a remote network share from a Windows / Linux box to you Mac, you can only user your short name.

The same applies to different ways of remotely accessing your Mac. If you're trying to log into your Mac thru FTP and you're supplying your full username, instead of your short name, it's going to fail every time. So, it's important to understand that you have two usernames and there's both a right time and a wrong time to use each.

Many of the problems people initially have when setting up and trying to access network shares can be eliminated by simply using the correct username and password combination.

Setting up User Accounts

Just like any other endeavor in life, knowing what you set out to do is important in how you initially set things up. If you're only going to be sharing files within your local area network with only yourself at a different computer, then it's probably a moot point to set-up another user just to share files.

However, if you're going to be opening up your computer for other people to have access to your data, setting up additional accounts is necessary.

In Mac OS X, you can add or modify user accounts in the System Preferences Pane. (Apple -> System Preferences -> Accounts).

In our example, we've set-up two local User Accounts, one named bonnell, and the other named admin. It's important to take note of each account's Short Name, as we are going to use it later.

A common sense suggestion is to only allow a user's account access to what he or she needs to do. For example, it would be ridiculous to give your roommate a full-blow Admin account on your girlfriend's machine, if you only want him to occasionally access things.

A better approach would be to limit his account, and grant him access to things on a need by need basis. By doing this you can identify what he's accessing and what you are giving him permission to do. A much safer way of doing things than the opposite — finding out later than he's *quot;accidentally" done something he shouldn't have. (shame on him)

Otherwise by opening up your box to just any stranger, you run the risk of having unauthorized access and could get your machine compromised — and you don't want just any stranger r00ting your girlfriends box do you?

You can set an accounts privileges by selecting on of three "buttons" in the Account's System Preference Pane under the Limitations tab. You're given three choices: No Limits, Some Limits, Simple Finder.

While things choices don't directly related to file-sharing permissions per se, they do allow you to configure what privileges the account can do. Just because you're creating the account for someone to have access to your machine for file-sharing purposes, doesn't mean you shouldn't let them have full control over everything.

Turning on Services

Assuming you've taken our advice and got your user accounts set-up, we next need to turn file-sharing on. The file-sharing options are also found in the System Preferences Pane (Apple -> System Preferences -> Sharing) under the Sharing icon.

In the Sharing Preference Pane we can turn on all of the low-level daemons responsible for opening up the necessary ports on your computer, and enabling such things as Windows File Sharing.

To start up the Windows file sharing, click the input box in front of the option for "Windows Sharing" and the aqua button to the right of the services list will go from Start to Stop.

When the Windows File Sharing service is up and running, the status text above the button will say "Windows Sharing On."

After the service is running, you'll want to take note of the important information at the very bottom of the pane. In my example, I was shown the following:

Windows users can access your computer at:
\\192.168.1.103\bonnell

This tells us what Windows users need to know to type in the address bar of their browser in order to access your computer. Before going any further, it's worthwhile to point out the meaning of the address that's being provided to us.

The breakdown of the SMB/CIFS naming scheme is to include two backslashes, the Computer's [Server] Name, followed by a single backslash, and then the name of the resource being shared. A graphical representation of the breakdown is show below:

\\server\share

It's not uncommon for the server name to be either an IP v4 Address or the NetBIOS name of a computer. However in our example, we're using the IP Address, as it's often easier and more reliable then using either the Hostname or NetBIOS name of the machine.

Free Troubleshooting Note: If you're trying to connect to an SMB/CIFS network share and using the Hostname or NetBIOS name and having trouble, try using the IP Address of the machine instead. Many times an incorrect network setting or DNS issue could be at fault. By using just the IP Address, you circumvent any DNS related problems and can more easily get to the root of the problem.

Some common examples of SMB shares are:

\\server.domain.com\share

\\computer\account\folder

\\192.168.1.100\user

Accessing your Mac from another computer

Now that we've got Windows File Sharing enabled, and turned on, we can now access our Mac remotely, whether it be from another Mac, a Windows PC, or even a Linux Server.

Note: This is Part II of a three part series on settting up Windows File Sharing in OS X. In the next installment of this tutorial, Part III, we'll put the finishing touches on accessing your network shares from a Windows ® machine and a Linux box.

Ryan J. BonnellRyan J. Bonnell is a Web Developer, Student, and leading contributor to MacZealots.com. When he is not playing around with his endless amount of toys, he can be reached at .

Reader Comments (8)

DISCLAIMER: The views expressed below are those of their authors and not necessarily endorsed or supported by MacZealots.com. In all cases, the comments provided here are offered as a courtesy and will be moderated. Any content deemed off-topic or offensive will be removed without notice. Posting a comment here boils down to two things: 1.) Think before you type 2.) Respect the thoughts of others. See our commenting guidelines and/or privacy policy for more information.

1 Kuhnen Brown remarks:
#1) On February 12, 2004 1:15 PM

Great series! I can’t wait till part III to finish up my Apple-XP file sharing.
From your reference to the Apple Knowledge Base I was able to learn how to connect the two platforms using an Ethernet crossover cable (since I am only interested in data exchange and not making an Internet connection.)
Your article is clear and to the point in getting the deed done. Thanks.
Kuhnen Brown

2 Andrew Park remarks:
#2) On March 18, 2004 6:12 PM

Yes I’m looking forward to part III too. That’s where the “rubber meets the road”, so please don’t leave us hanging too long. I’ve had no end of troubles getting my wife’s Thinkpad with W2k to connecto my networked macs and vice versa.

3 Bernard Quesnel remarks:
#3) On September 15, 2004 12:25 PM

I’ve been using Macs from the 1980’s Classic ( I still have one with the signatures on the inside cover) right up to the (almost) current model. I live in the West Indies. Trinidad & Tobago, the last island of the Caribbean chain of islands.

Good information but I have a more complicated problem that I hope you can help with. My Windows XP machine can see the OS X startup disk.

My problem is that I have a partitioned 80G disk on the Mac. To load OS X I had to partition an 8Gig volume and the rest as another volume. When I log onto the Mac from the PC I am only able to see the Start up drive on the Mac and not the other volume which has the information that I want.

Any idea on how can I see and use the files on the other partition?

4 Ryan J. Bonnell remarks:
#4) On September 16, 2004 1:55 AM

Bernard,

Yes, the behavior you describe is correct. By default, OS X only “shares” the home directory of the boot volume, and if you’ve got multiple drives and/or partitions, you won’t be able to access them thru typical file-sharing.

File sharing does work differently under OS X than it used to under OS 9. With File Sharing on in OS X, you can mount your own hard disk remotely. Guest access is automatic, but guests can only drop files into your public folder in your home directory (located at /Users/Public). They cannot take files from the directory, or even see them after theyć± e placed inside.

Note: If a remote user knows your Mac OS X user name and administrator password, they could log on and see all your files with same same privileges as yourself - this may not be ideal. By default, Mac OS X will share the Public folders of each user account on the computer with everybody while File Sharing is enabled.

One simple work-a-round to your problem is to enable sFTP access on your Mac, which will allow a client to access any (and I do mean any) folder on your computer. Partitions and drives can be access thru the /Volumes directory, which has symbolic links to the mounted media on your computer.

However, if you’re wanting a more “Finder like experience” when browsing remote files, and don’t want to have to rely on a dedicated FTP program, then there’s some options you can explore. The functionality you want isn’t built-into Apple’s GUI at all, rather it’s a function of SAMBA - a set of software technologies that allows for file-sharing between all major computer platforms. (it’s what Windows uses to share files)

SharePoints is an application or a preference pane that makes it easy to add and delete share points like in the old Finder. In Mac OS X, by default, you are limited to sharing only what is in your public folder in your home directory. This program makes it easy to share any folder.

SharePoints
http://www.hornware.com/sharepoints/

In addition SharePoints also brings back users and groups management to Mac OS X as well as easy configuration of AppleFileServer (AFS) and Samba (SMB) Server properties.

If you’re wanting a more robust solution on sharing files between your two platforms, you might want to look into some commercial software packages like Miramar Systems’ PC MACLAN or Thursby Software’s Dave.

Miramar Systems’ PC MACLAN
http://www.miramar.com/Products/PC_MACLAN/

Thursby Software’s Dave
http://www.thursby.com/products/dave.html

Good luck in getting your file sharing straightened out !

5 Bernard Quesnel remarks:
#5) On September 16, 2004 9:15 PM

Ryan,

Thanks first of all for responding, second of all for responding quickly and thirdly for directing me to the right solution to my problem.

I used the sharepoints as suggested. Took me a little while to get it functioning properly as the instructions and documentation was not explicit enough, but I managed to get it done and that’s what’s important.

Keep up the good work and let people realize that the mac is without a doubt a superior machine.

Really appreciate the help,

Bernard

6 Rick remarks:
#6) On October 3, 2004 9:53 AM

I set up a customer to share files with XP. The Mac saw the folders once. But when you go to connect to server on the Mac, I get a window with other computer shortcuts. Interestingly after hitting connect to server, I have to browse. When I try to connect to the XP box,or any other box, it says it’s not available. WHAT’S UP?

7 Ross B remarks:
#7) On November 14, 2004 3:19 PM

I have just got a mac and running OS X I have used this article to gain access from another PC to my mac but I still cannot gain access the from the Mac to the PC. I keep getting “to see availavle shares for server “xxxx” press ‘connect”. When I do this I get the message “SMB/CIFS filesystem authenication” …”enter the user name and password for [REMOTE PC]” and I cannot get any further. Please can someone help me?! Please email me if you can! Ross

8 Ted Jerome remarks:
#8) On September 27, 2005 11:36 AM

Ryan, are you still alive? Part II was written in Jan 2004, and there’s still no Part III!
Eagerly anticipated.
Please?