Chapter 13. Networking, File Sharing, & Screen Sharing

Networks are awesome. Once you’ve got a network, you can copy files from one machine to another—even between Windows PCs and Macs—just as you’d drag files between folders on your own Mac. You can send little messages to other people’s screens. Everyone on the network can consult the same database or calendar, or listen to the same iTunes music collection. You can play games over the network. You can share a single printer or cable modem among all the Macs in the office. You can connect to the network from wherever you are in the world, using the Internet as the world’s longest extension cord back to your office.

In Snow Leopard, you can even do screen sharing, which means that you, the wise computer whiz, can see what’s on the screen of your pathetic, floundering relative or buddy elsewhere on the network. You can seize control of the other Mac’s mouse and keyboard. You can troubleshoot, fiddle with settings, and so on. It’s the next best thing to being there—often, a lot better than being there.

This chapter concerns itself with local networking—setting up a network in your home or small office. But don’t miss its sibling, Chapter 18, which is about hooking up to the somewhat larger network called the Internet.

Most people connect their computers using one of two connection systems: Ethernet or WiFi (which Apple calls AirPort).

Every Mac (except the MacBook Air) and every network-ready laser printer has an Ethernet jack (Figure 13-1). If you connect all the Macs and Ethernet printers in your small office to a central Ethernet hub or router—a compact, inexpensive box with jacks for five, 10, or even more computers and printers—you’ve got yourself a very fast, very reliable network. (Most people wind up hiding the hub in a closet and running the wiring either along the edges of the room or inside the walls.) You can buy Ethernet cables, plus the hub, at any computer store or, less expensively, from an Internet-based mail-order house; none of this stuff is Mac-specific.

Ethernet is the best networking system for many offices. It’s fast, easy, and cheap.

WiFi, known to the geeks as 802.11 and to Apple fans as AirPort, means wireless networking. It’s the technology that lets laptops the world over get online at high speed in any WiFi “hot spot.” Hot spots are everywhere these days: in homes, offices, coffee shops (notably Starbucks), hotels, airports, and thousands of other places.

Tip

At www.jiwire.com, you can type in an address or a city and learn exactly where to find the closest WiFi hot spots.

When you’re in a WiFi hot spot, your Mac has a very fast connection to the Internet, as though it’s connected to a cable modem or DSL.

AirPort circuitry comes preinstalled in every Mac laptop, iMac, and Mac Mini, and you can order it built into a Mac Pro.

This circuitry lets your machine connect to your network and the Internet without any wires at all. You just have to be within about 150 feet of a base station or access point (as Windows people call it), which must in turn be physically connected to your network and Internet connection.

If you think about it, the AirPort system is a lot like a cordless phone, where the base station is, well, the base station, and the Mac is the handset.

The base station can take any of these forms:

A few, proud people still get online by dialing via modem, which is built into some old AirPort base station models. The base station is plugged into a phone jack. Wireless Macs in the house can get online by triggering the base station to dial by remote control.

For the easiest AirPort network setup, begin by configuring your Mac so that it can go online the wired way, as described in the previous pages. Once it’s capable of connecting to the Internet via wires, you can then use the AirPort Utility (in your Applications→Utilities folder) to transmit those Internet settings wirelessly to the base station itself. From then on, the base station’s modem or Ethernet jack—not your Mac’s—will do the connecting to the Internet.

Whether you’ve set up your own wireless network or want to hop onto somebody else’s, Chapter 18 has the full scoop on joining WiFi networks.

FireWire networks?

You’re forgiven for splurting your coffee. Everyone knows that FireWire is great for hooking up a camcorder or a hard drive, and a few people know about FireWire Disk Mode. But not many people realize that FireWire makes a fantastic networking cable, since it’s insanely, blisteringly fast. (All right, gigabit Ethernet is faster, and so is FireWire 800. But attaining that kind of networking nirvana requires that all your Macs, hubs, and other networking gear are all compatible with gigabit Ethernet or FireWire 800.)

FireWire networking, technically known as IP over FireWire, is an unheralded, unsung feature of Mac OS X. But when you have a lot of data to move between Macs—your desktop and your laptop, for example—a casual FireWire network is the way to go. It lets you copy a gigabyte of email, pictures, or video files in a matter of seconds.

Here’s how you unleash this secret feature:

When you’re done wiring (or not wiring, as the case may be), your network is ready. Your Mac should “see” any Ethernet or shared USB printers, in readiness to print (Chapter 14). You can now play network games or use a network calendar. And you can now turn on File Sharing, one of the most useful features of all.

In File Sharing, you can summon the icon for a folder or disk attached to another computer on the network, whether it’s a Mac or a Windows PC. It shows up in a Finder window, as shown in Figure 13-3.

At this point, you can drag files back and forth, exactly as though the other computer’s folder or disk is a hard drive connected to your own machine.

The thing is, it’s not easy being Apple. You have to write one operating system that’s supposed to please everyone, from the self-employed first-time computer owner to the network administrator for NASA. You have to design a networking system simple enough for the laptop owner who just wants to copy things to a desktop Mac when returning from a trip, yet secure and flexible enough for the network designer at a large corporation.

Clearly, different people have different attitudes toward the need for security and flexibility.

That’s why Snow Leopard offers two ways to share files—a simple and limited way, and a more complicated and flexible way:

If the Public folder method seems too simple and restrictive, then you can graduate to the “share any folder” method. In this scheme, you can make any file, folder, or disk available to other people on the network.

This time, you don’t have to move your files anywhere; they sit right where you have them. And this time, you can set up elaborate sharing privileges (also known as permissions) that grant individuals different amounts of access to your files.

This method is more complicated to set up than that Public-folder business. In fact, just to underline its complexity, Apple has created two different setup procedures. You can share one icon at a time by opening its Get Info window; or you can work in a master list of shared items in System Preferences.

The following pages cover both methods.

Here’s how to share a Mac file, disk, or folder disk using its Get Info window.

The following steps assume that you’ve turned on →System Preferences→Sharing→File Sharing, as shown in Figure 13-3.

  1. Highlight the folder or disk you want to share. Choose FileGet Info.

    The Get Info dialog box appears (Figure 13-4). Expand the General panel, if it’s not already visible.

  2. Turn on “Shared folder.”

    Enter your administrative password, if necessary.

    OK, this disk or folder is now shared. But with whom?

  3. Expand the Sharing & Permissions panel, if it’s not already visible. Click the icon and enter your administrator’s password.

    The controls in the Sharing & Permissions area spring to life and become editable. At the bottom of the Info panel is a little table. The first column can display the names of individual account holders, like Casey or Chris, or groups of account holders, like Everyone or Accounting Dept.

    The second column lists the privileges each person or group has for this folder.

    Now, the average person has no clue what “privileges” means, and this is why things get a little hairy when you’re setting up folder-by-folder permissions. But read on; it’s not as bad as it seems.

  4. Edit the table by adding people’s names. Then set their access permissions.

    At the moment, your name appears in the Name column, and it probably says Read & Write in the Privilege column. In other words, you’re currently the master of this folder. You can put things in, and you can take things out.

    In other words, if you just want to share files with yourself, so you can transfer them from one computer to another, you can stop here.

    If you want to share files with other people, well, note that at the moment, the privileges for “Everyone” is probably set to “Read only.” Other people can see this folder, but they can’t do anything with it.

    Your job is to work through this list of people, specifying how much control each person has over the file or folder you’re sharing.

    To add the name of a person or group, click the button below the list. The people list shown in Figure 13-5 appears.

    Now click a name in the list. Then, from the Privilege pop-up menu, choose a permissions setting.

    Read & Write has the most access of all. This person, like you, can add, change, or delete any file in the shared folder, or make any changes they like to a document. Give Read & Write permission to people you trust not to mess things up.

    Read only means “Look, but don’t touch.” This person can see what’s in the folder (or file) and can copy it, but they can’t delete or change the original. It’s a good setting for distributing company documents or making source files available to your minions.

    Write only (drop box) means that other people can’t open the folder at all. They can drop things into it, but it’s like dropping icons through a mail slot: The letter disappears into the slot, and then it’s too late for them to change their minds. As the folder’s owner, you can do what you like with the deposited goodies. This drop-box effect is great when you want students, coworkers, or family members to be able to turn things in to you—homework, reports, scandalous diaries—without running the risk that someone else might see those documents. (This option doesn’t appear for documents—only disks and folders.)

    No access is an option only for “Everyone.” It means that other people can see this file or folder’s icon but can’t do a thing with it.

  5. Close the Get Info window.

    Now the folder is ready for invasion from across the network.

It’s very convenient to turn on sharing one folder at a time, using the Get Info window. But there’s another way in, too, one that displays all your shared stuff in one handy master list.

To see it, choose →System Preferences. Click Sharing. Click File Sharing (and make sure it’s turned on).

Now you’re looking at a slightly different kind of permissions table, shown in Figure 13-6. It has three columns:

And now, having slogged through all these options and permutations, your Mac is ready for invasion from across the network.

So far in this chapter, you’ve read about setting up a Mac so people at other computers can access its files.

Now comes the payoff: sitting at another computer and connecting to the one you set up. There are two ways to go about it: You can use the Sidebar, or you can use the older, more flexible Connect to Server command. The following pages cover both methods.

Suppose, then, that you’re seated in front of your Mac, and you want to see the files on another Mac on the network. Proceed like this:

  1. Open any Finder window.

    In the Shared category of the Sidebar at the left side of the window, icons for all the computers on the network appear. See Figure 13-7.

    If you don’t see a certain Mac’s icon here, it might be turned off, it might not be on the network, or it might have File Sharing turned off. (And if you don’t see any computers at all in the Sidebar, then your computer might not be on the network. Or maybe you’ve turned off the checkboxes for “Connected Servers” and “Bonjour Computers” in Finder→Preferences→Sidebar.)

    If there are a lot of computer icons in the Sidebar, or if you’re on a corporate-style network that has sub-chunks like nodes or workgroups, you may also see an icon called All. Click it to see the full list of network entities that your Mac can see: not just individual Mac, Windows, and Unix machines, but also any “network neighborhoods” (limbs of your network tree). For example, you may see the names of network zones (clusters of machines, as found in big companies and universities).

    Or, if you’re trying to tap into a Windows machine, open the icon representing the workgroup (computer cluster) that contains the machine you want. In small office networks, it’s usually called MSHOME or WORKGROUP. In big corporations, these workgroups can be called almost anything—as long as it’s no more than 12 letters long with no punctuation. (Thanks, Microsoft.)

    If you do see icons for workgroups or other network “zones,” double-click until you’re seeing the icons for individual computers.

  2. Click the computer whose files you want to open.

    In the main window, you now see the icons for each account holder on that computer: Mom, Dad, Sissy, whatever. If you have an account on the other computer, you’ll see a folder representing your stuff, too (Figure 13-8).

    At this point, the remaining instructions diverge, depending on whether you want to access other people’s stuff or your stuff. That’s why there are two alternative versions of step 3 here:

  3. If you want to access the stuff that somebody else has left for you, double-click that person’s Public folder.

    Instantly, the icon for that folder appears on your desktop, and an Eject button () appears beside the computer’s name in the Sidebar.

    In this situation, you’re only a Guest. You don’t have to bother with a password. On the other hand, the only thing you can generally see inside the other person’s account folder is his Public folder.

    One thing you’ll find inside the Public folder is the Drop Box folder. This folder exists so that you can give files and folders to the other person. You can drop any of your own icons onto the Drop Box folder—but you can’t open the Drop Box folder to see what other people have put there. It’s one-way, like a mail slot in somebody’s front door.

    If you see anything else at all in the Public folder you’ve opened, then it’s stuff the account holder has copied there for the enjoyment of you and your network mates. You’re not allowed to delete anything from the other person’s Public folder or make changes to anything in it.

    You can, however, open those icons, read them, or even copy them to your Mac—and then edit your copies.

  4. To access your own Home folder on the other Mac, click it, and then click the Connect As button (Figure 13-9). Sign in as usual.

    When the “Connect to the file server” box appears, you’re supposed to specify your account name and password (from the Mac you’re tapping into). This is the same name and password you’d use to log in if you were actually sitting at that machine.

    Type your short user name and password. (If you’re not sure what your short user name is, open System Preferences on your home-base Mac, click Accounts, and then click your account name.) And if you didn’t set up a password for your account, leave the password box empty.

Tip

The dialog box shown in Figure 13-9 includes the delightful and timesaving “Remember this password in my keychain” option, which makes the Mac memorize your password for a certain disk so you don’t have to type it—or even see this dialog box—every darned time you connect. (If you have no password, though, the “Remember password” doesn’t work, and you’ll have to confront—and press Return to dismiss—the “Connect to the file server” box every time.)

When you click Connect (or press Return or Enter), your own Home folder on the other Mac appears. Its icon shows up on your desktop, and a little button appears next to its name. Click it to disconnect.

In the meantime, you can double-click icons to open them, make copies of them, and otherwise manipulate them exactly as though they were icons on your own hard drive. Depending on what permissions you’ve been given, you can even edit or trash those files.

You can even use Spotlight to find files on that networked disk. If the Mac across the network is running Leopard or Snow Leopard, in fact, you can search for words inside its files, just as though you were sitting in front of it. If not, you can still search for text in files’ names.

The Sidebar method of connecting to networked folders and disks is practically effortless. It involves nothing more than clicking your way through folders—a skill that, in theory, you already know.

But the Sidebar method has its drawbacks. For example, the Sidebar doesn’t let you type in a disk’s network address. As a result, you can’t access any shared disk on the Internet (an FTP site, for example), or indeed anywhere beyond your local subnet (your own small network).

Fortunately, there’s another way. When you choose Go→Connect to Server, you get the dialog box shown in Figure 13-10. You’re supposed to type in the address of the shared disk you want.

For example, from here you can connect to:

Once you type it and press Return, the FTP server appears as a disk icon on your desktop (and in the Sidebar). Its contents appear, too, ready to open or copy.

And now, some timesaving features in the Connect to Server box:

When you’re finished using a shared disk or folder, you can disconnect from it by clicking the icon next to its name in the Sidebar.

Microsoft Windows may dominate the corporate market, but there are Macs in the offices of America—and there are PCs in homes. Fortunately, Macs and Windows PCs can see each other on the network, with no special software (or talent) required.

In fact, you can go in either direction. Your Mac can see shared folders on the Windows PC, and a Windows PC can see shared folders on your Mac.

It goes like this.

Suppose you have a Windows PC and a Mac on the same wired or wireless network. Here’s how you get the Mac and PC chatting:

  1. On your Windows PC, share some files.

    This isn’t really a book about Windows networking (thank heaven), but here are the basics.

    Just as on the Mac, there are two ways to share files in Windows. One of them is super-simple: You just copy the files you want to share into a central, fully accessible folder. No passwords, accounts, or other steps are required.

    In Windows XP, that special folder is the Shared Documents folder, which you can find by choosing Start→My Computer. Share it on the network as shown in Figure 13-12, top.

    In Windows Vista, it’s the Public folder, which appears in the Navigation pane of every Explorer window. (In Vista, there’s one Public folder for the whole computer, not one per account holder.)

    In Windows 7, there’s a Public folder in each of your libraries. That is, there’s a Public Documents, Public Pictures, Public Music, and so on.

    The second, more complicated method is the “share any folder” method, just as in Leopard. In XP or Vista, you right-click the folder you want to share, choose Properties from the shortcut menu, click the Sharing tab, and turn on “Share this folder on the network” (Figure 13-12, top). In Windows 7, use the Share With menu at the top of any folder’s window. See the box on Windows 7 Hell for more details.

    Repeat for any other folders you want to make available to your Mac.

  2. On the Mac, open any Finder window.

    The shared PCs may appear as individual computer names in the Sidebar, or you may have to click the All icon to see the icons of their workgroups (network clusters—an effect shown on Accessing Shared Files). Unless you or a network administrator changed it, the workgroup name is probably MSHOME or WORKGROUP. Double-click the workgroup name you want.

    Tip

    You can also access the shared PC via the Connect to Server command, as described on Connection Method B: Connect to Server. You could type into it smb://192.168.1.103 (or whatever the PC’s IP address is) or smb://SuperDell (or whatever its name is) and hit Return—and then skip to step 5. In fact, using the Connect to Server method often works when the Sidebar method doesn’t.

    Now the names of the individual PCs on the network appear in your Finder window. (If you’re running Windows 7, see the box on When Windows 7 Can’t See the Mac.)

  3. Double-click the name of the computer you want.

    If you’re using one of the simple file-sharing methods on the PC, as described above, that’s all there is to it. The contents of the Shared Documents or Public folder now appear on your Mac screen. You can work with them just as you would your own files.

    If you’re not using one of those simple methods, and you want access to individual shared folders, read on.

  4. Click Connect As.

    This button appears in the top-right corner of the Finder window; you can see it at bottom in Figure 13-12.

    Now you’ re asked for your name and password (Figure 13-13, top).

  5. Enter the name and password for your account on the PC, and then click OK.

    At long last, the contents of the shared folder on the Windows machine appear in your Finder window, just as though you’d tapped into another Mac (Figure 13-13, bottom). The icon of the shared folder appears on your desktop, too, and an Eject button () appears next to the PC’s name in your Sidebar.

    From here, it’s a simple matter to drag files between the machines, open Word documents on the PC using Word for the Mac, and so on—exactly like you’re hooked into another Mac.

Cross-platformers, rejoice: Mac OS X lets you share files in both directions. Not only can your Mac see other PCs on the network, but they can see the Mac, too.

On the Mac, open →System Preferences→Sharing. Click File Sharing (make sure File Sharing is turned on), and then click Options to open the dialog box shown in Figure 13-14.

Turn on “Share files and folders using SMB (Windows).” Below that checkbox, you see a list of all the accounts on your Mac. Turn on the checkboxes to specify which Mac user accounts you want to be able to access. You must type in each person’s password, too. Click Done.

Before you close System Preferences, study the line near the middle of the window, where it says something like: “Other users can access your computer at afp://192.168.1.108 or MacBook-Pro.” You’ll need one of these addresses shortly.

Now, on Windows XP, open My Network Places; in Windows Vista, choose Start→Network; in Windows 7, expand the Network heading in the sidebar of any desktop window. If you’ve sacrificed the proper animals to the networking gods, your Mac’s icon should appear by itself in the network window, as shown in Figure 13-15, top.

Double-click the Mac’s icon. Public-folder stuff is available immediately. Otherwise, you have to sign in with your Mac account name and password; Figure 13-15, middle, has the details.

In the final window, you see your actual Home folder—on a Windows PC! You’re ready to open its files, copy them back and forth, or whatever (Figure 13-15, bottom).

If your Mac’s icon doesn’t appear, and you’ve read the box on When the Mac Doesn’t See the PC, wait a minute or two. Try restarting the PC. In Windows XP, try clicking “Microsoft Windows Network” or “View workgroup computers” in the task pane.

If your Mac still doesn’t show up, you’ll have to add it the hard way. In the address bar of any Windows window, type \\macbook-pro\chris (but substitute your Mac’s actual computer name and your short account name), taking care to use backslashes, not normal / slashes. You can also type your Mac’s IP address in place of its computer name.

In the future, you won’t have to do so much burrowing; your Mac’s icon should appear automatically in the My Network Places or Network window.

The prayers of baffled beginners and exasperated experts everywhere have now been answered. Now, when the novice needs help from the guru, the guru doesn’t have to run all the way downstairs or down the hall to assist. Thanks to Snow Leopard’s screen-sharing feature, you can see exactly what’s on the screen of another Mac, from across the network—and even seize control of the other Mac’s mouse and keyboard (with the newbie’s permission, of course).

(Anyone who’s ever tried to help someone troubleshoot over the phone knows exactly what this means. If you haven’t, this small example may suffice: “OK, open the Apple menu and choose ‘About This Mac.’” Pause. “What’s the Apple menu?”)

Nor is playing Bail-Out-the-Newbie the only situation when screen sharing is useful. It’s also great for collaborating on a document, showing something to someone for approval, or just freaking each other out. It can also be handy when you are the owner of both Macs (a laptop and a desktop, for example), and you want to run a program that you don’t have on the Mac that’s in front of you. For example, you might want to adjust the playlist selection on the upstairs Mac that’s connected to your sound system.

Or maybe you just want to keep an eye on what your kids are doing on the Macs upstairs in their rooms.

The controlling person can do everything on the controlled Mac, including running programs, messing around with the folders and files, and even shutting it down.

Mac OS X is crawling with different ways to use screen sharing. You can do it over a network, over the Internet, and even during an iChat chat.

Truth is, the iChat method, described in Chapter 21, is much simpler and better than the small-network method described here. It doesn’t require names or passwords, it’s easy to flip back between seeing the other guy’s screen and your own, and you can transfer files by dragging them from your screen to the other guy’s (or vice versa).

Then again, the small-network method described here is built right into the Finder, doesn’t require logging into iChat, and doesn’t require Leopard or Snow Leopard running on both computers.

As always, trying to understand meta concepts like seeing one Mac’s screen on the monitor of another can get confusing fast. So in this example, suppose that you want to take control of Mac #1 while seated at Mac #2.

Now, it would be a chaotic world (although greatly entertaining) if any Mac could randomly take control of any other Mac. Fortunately, though, nobody can share your screen or take control of your Mac without your explicit permission.

To give such permission, choose →System Preferences→Sharing, and then turn on Screen Sharing.

At this point, there are three levels of security to protect your Mac against unauthorized remote-control mischief:

Alternatively, if you’re only a little bit of a Scrooge, you can set things up so that they can request permission to share your screen—as long as you’re sitting in front of your Mac at the time and feeling generous.

To set this up, click Computer Settings and then turn on “Anyone may request permission to share screen.” Now your fans will have to request permission to enter, and you’ll have to grant it (by clicking OK on the screen), in real time, while you’re there to watch what they’re doing.

All right, Mac #1 has been prepared for invasion. Now suppose you’re the person on the other end. You’re the guru, or the parent, or whoever wants to take control.

Sit at Mac #2 elsewhere on your home or office network. Open a Finder window. Expand the Sharing list in the Sidebar, if necessary, so that you see the icon of Mac #1.

When you click that Mac’s icon, the dark strip at the top of the main window displays a button that wasn’t there before: Share Screen. Proceed as shown in Figure 13-17.

Tip

In theory, you can also connect from across the Internet, assuming you left your Mac at home turned on and connected to a broadband modem, and assuming you’ve worked through the port-forwarding issue described on Web Sharing.

In this case, though, you’d begin by choosing Go→Connect to Server in the Finder; in the Connect to Server box, type in vnc://123.456.78.90 (or whatever your home Mac’s public IP address is). The rest of the steps are the same.

If you’ve signed in successfully, or if permission is granted, then a weird and wonderful sight appears. As shown in Figure 13-18, your screen now fills with a second screen—from the other Mac. You have full keyboard and mouse control to work with that other machine exactly as though you were sitting in front of it.

Well, maybe not exactly. There are a few caveats.

The steps above guide you through screen sharing between two Leopard or Snow Leopard Macs. But screen-sharing is based on a standard technology called VNC, and Mac OS X is bristling with different permutations.

“Back to My Mac” is intended to simplify the nightmare of remote networking. It works only if:

Once that’s all in place, your Macs behave exactly as though they’re on the same home network, even though they can be thousands of miles apart across the network.

To set it up, proceed as shown in Figure 13-20.

Now, on each Mac you’ll want to “visit” from afar, open the System Preferences→Sharing pane and turn on File Sharing and/or Screen Sharing.

Then, on your laptop in New Zealand, you see an entry for Back to My Mac in the Sharing section of your Sidebar. Click to see the icon of your Mac back at home. At this point, you can connect to it for file sharing by clicking Connect As (Connection Method A: Use the Sidebar), or take control of it by clicking Share Screen (Mac #2: Take Control).

In theory, Back to My Mac spares you an awful long visit to networking hell (including the port-forwarding headache described on Web Sharing), because Apple has done all the configuration work for you.

All the technical details are available online. Go to http://search.info.apple.com and do a search for 306672. (That’s the article number that explains the Back to My Mac issues.)

If you’re one of the several million lucky people who have full-time Internet connections—in other words, cable modem or DSL accounts—a special thrill awaits. You can connect to your Mac from anywhere in the world via the Internet. If you have a laptop, you don’t need to worry when you discover you’ve left a critical file on your desktop Mac at home.

Mac OS X offers several ways to connect to your Mac from a distant location, including file sharing over the Internet, Back to My Mac, virtual private networking, FTP, and SSH (secure shell). Chapter 22 has the details.