Using Network Sharing

In addition to sharing your computer with other users, the Mac makes it easy to share files with other computers on the same network and over the Internet. At the same time, some limitations are placed on what you can share that might require changes in the way your Macintosh network is set up.

Sharing Services

A service is something that your computer provides to other computers on a network, such as running a Web server or sharing files. In Mac OS X 10.2, you can enable or disable all the standard information-sharing services from the Services tab of the Sharing panel in System Preferences, as shown in Figure 27.7.

Figure 27.7. The Services tab of Sharing Preferences enables you to choose which sharing services you want run running on your computer.



Be aware that turning on or off any service in the Sharing panel activates that service for everyone on the machine. If sharing is on for one user , it's on for everyone. If it's off, it's off for everyone!

You can enable or disable the following services:

  • Personal File Sharing Share your files with other Mac users across a local network. We'll discuss activating AppleTalk, if needed, in just a moment.

  • Windows File Sharing Share your files with Windows users on your local network.

  • Personal Web Sharing Serve Web pages from your own computer using the built-in Apache Web server. You'll learn more later in this chapter.

  • Remote Login Allow Secure Shell (SSH) command-line access to your machine from remote machines. You'll learn more later in this chapter.

  • FTP Access Allow access to your machine via FTP, (File Transfer Protocol). You'll learn more later.

  • Remote Apple Events Allow software running on other machines to send events to applications on your computer using the AppleScript scripting language. As this requires some specialized programming, we don't delve into this option.

  • Printer Sharing Grant other computers access to the printers connected to your computer. With this service enabled, your printers appear in the Print Center's printer list for other users on your local network.


The Firewall tab of the Sharing control pane contains a list of the same options as the Services tab. A firewall is something that sits between the outside network and network services on your computer to protect your computer from network-based attacks. The Firewall tab enables you to activate Mac OS X's built-in firewall software to prevent access to your computer through those services you don't want to run. We'll discuss this further later in this chapter.

Now, let's take at look at sharing and using these services.

Activating Personal File Sharing and AppleTalk

Personal File Sharing is Apple's method of sharing files with other Mac users over a network, either via TCP/IP or AppleTalk. AppleTalk is a legacy protocol for browsing and accessing remote workstations that share files or services, such as printers. Apple is transitioning to using the TCP/IP-based Service Locator Protocol (SLP) and Rendezvous to provide this functionality on modern Mac networks. Unfortunately, until everyone is running Mac OS X, you might still need to enable AppleTalk to access older devices.

Follow these steps to share your files with another Mac user:

  1. Determine whether you need to use AppleTalk to access computers and printers on your network. If all the other computers are Mac OS X machines and your printer is USB-based, you probably don't need AppleTalk supportskip ahead to step 8. If you're not sure, go to step 2.

  2. Open the Network Preferences panel, found in the Internet & Network section of System Preferences.

  3. Use the Show pop-up menu to choose the device you're using to access your network (such as AirPort or Ethernet).

  4. Click the AppleTalk tab.

  5. Check the box for Make AppleTalk Active, as shown in Figure 27.8. (To make the change, you might first have to click the small lock button at the bottom of the window and type an administrator's username and password.)

    Figure 27.8. Make sure that AppleTalk is active before trying to share files on a Mac OS network composed of both OS X users and users of older operating systems.



    Remember that the first-created user account is an administrative account. Other accounts may or may not be administrative, depending how they were set up.

  6. If necessary, choose an AppleTalk Zone to use. You might want to speak to your network administrator if you aren't sure what to choose.

  7. Click Apply Now.

  8. Open the Sharing Preferences pane, as shown in Figure 27.7, and check the box for Personal File Sharing, or highlight it and click the Start button.

  9. Close the System Preferences window.

Your Mac OS X computer should now be able to share files with other Macs on your network. We'll talk about how to actually connect to other users' files later in this chapter.

Activating Windows Sharing (Samba)

Windows computers use a system called SMB (Simple Message Block) for file and print sharing. To share files with Windows computers, your Mac uses the same protocol through a piece of software called Samba.


The latest version of SMB is known as CIFS (Common Internet File System), which is an open version of SMB with some Internet-specific modifications. For the sake of remaining reasonably sane, you can assume that CIFS and SMB are synonymous.

To turn on Windows Sharing (Samba), open the Sharing System Preferences panel to the Services tab, and then either click the check box in front of the Windows File Serving line, or highlight it and click the Start button. The Sharing panel updates and shows the path that can be used to map (mount) the drive of your Mac on a Windows-based computer, as demonstrated in Figure 27.9.

Figure 27.9. Activate Samba for file sharing with Windows computers by using the Sharing preference panel.


Like AppleShare file sharing in Mac OS X, the built-in Samba configuration is limited to sharing each user's home directory. By default, none of the user accounts are enabled for login. Enable login from Windows by opening the Accounts System Preferences panel, selecting the user to have Samba access, and then clicking the Edit User button. Your screen will look similar to Figure 27.10.

Figure 27.10. Edit the user accounts that should be able to access your computer from Windows.


If necessary, enter the current user password, press the Return key, and then click the Allow User to Log In from Windows check box. The home directory of the user can now be accessed through a path following the format:

 \  <hostname or IP address>  \  <username>  

Keep in mind that the person logging in from Windows must be identified as the same user the Mac account recognizes, meaning it is necessary to log in to Windows using the username and password of the account on Mac OS X. Be sure to enter your username in all lowercase characters and the password just as you entered it in Mac OS X.

Activating Web Sharing

Mac OS X makes it easy to run a simple Web server from your own personal computer, using popular server software called Apache. What makes this so astounding is that Apache is actually the server that powers most Internet Web sites. It's built to run extremely complex sites, including e-commerce and other interactive applicationsand it's running on your desktop.

Mac OS X can share a personal Web site for each user on the computer. In addition, it can run a master Web site for the whole computer entirely independent of the personal Web sites.

To turn on Web sharing, open the Sharing System Preferences panel (shown in Figure 27.7), and check the box for Personal Web Sharing or highlight it and click the Start button. The Apache server starts running, making your Web site immediately available. Make a note of the URL shown at the bottom of the window, and then start Internet Explorer to verify that your personal site is online.

To test this, launch a web browser, such as Internet Explorer, and enter your personal Web site URL, which should look like the following:

 http://  <server ip or hostname>  /~  <username>  

The tilde ( ~ ) is extremely critical. It tells the server that it should load the Web pages from the Sites folder located inside the user's home directory. Note that after you activate Web sharing for one user, it's active for all users, so be sure that all users are ready to have their Web sites shared with the rest of the world.

Assuming that you entered your URL correctly, you should see the default Mac OS X home page, as demonstrated in Figure 27.11.

Figure 27.11. Apple includes a default personal home page.


To edit your Web site, just look inside the Sites folder in your user account. The default page is generated from the file index.html and the Images folder.


Under Mac OS X's user interface, it isn't possible to change the filename of your home page. When you start creating files, be certain that the first page you want to be loaded is named index.html ; otherwise , your site might not behave as you hope.

If you're the adventurous sort , you've probably tried typing in the URL of your machine without including the ~ <username> portion. If you haven't, try it now. What you should see is that a different Web page loads. This is the system Web site and it can be used for anything you want, but you must do a bit of digging to reach the directory that holds it.

The system-level site is located in /Library/WebServer/Documents . Any administrator can make changes to this directory, so be sure that the other admin users on the system understand its purpose and that they don't assume that it's related to their personal Web sites.

Activating Remote Login and FTP

Two additional methods of file sharing available are FTP and SSH. File Transfer Protocol provides cross-platform file-transfer services so others can connect to your computer and download files. The second type of sharing, SSH (secure shell), enables a remote user to send commands to a Mac OS X computer from anywhere in the world.

As you might expect, both of these protocols can be turned on using the Sharing System Preferences panel. SSH is turned on through the Remote Login check box, as you saw in Figure 27.7. Activate FTP by simply clicking the Allow FTP Access check box. Alternatively, you can highlight the option you want to activate and click the Start button.

Now that you know how to turn these services on, let's see what they can do for you!

Remote Login (SSH)

SSH, or as Apple calls it in the Sharing panel: Remote Login, is an entirely new concept for most Mac users. If you've seen a Windows or a Linux computer before, you've probably occasionally seen someone open a command prompt and start typing. Contrary to the sentiment many Mac users have, the command line is not evil! In Mac OS X, it's a very powerful and entirely optional tool. As you start to explore the command line later in this book, you'll understand that it can be used to manage your files, monitor your system, and even control server processes.

SSH isn't the command line itself, but it provides a secure means of accessing the command line from a remote location. In an SSH connection, the entire session is encrypted. As such, administrators can log in to their systems using SSH and edit user accounts, change passwords, and so on, without the fear of giving away potentially damaging information.

If you're not interested in the command line, don't worrythere's absolutely no reason why you have to use SSH.


If you're planning to serve FTP and SSH only occasionally, shut off the services in the Sharing panel until you're ready to use them. This closes some open doors that unwelcome " visitors " may use to access your computer. With SSH and FTP shut off, you can still use the Mac OS X clients and command line to access other SSH/FTP servers, but remote users can't connect to your machine. We'll talk more about security issues at the end of this chapter.


With FTP enabled, someone in another place can reach files on your machine by typing the following into an FTP application:

  ftp://   <mac os username>   :   <mac os password>   @   <ip address or hostname>  

This tells the Web browser to contact the Mac OS X computer running the FTP server, login with the given username and password, and display the files in that user's home directory.

If you have the need to transfer large files between computers over the Internet, here are several FTP clients that can be used to access remote FTP servers:

  • Fetch

  • Interarchy

  • NetFinder http:// members

  • Transmit

If you need to share files over the Internet, FTP is one of the best ways to do so. It's fast, effective, and a very efficient protocol. Unfortunately, it's also not easy to work with behind firewalls, and it transmits its passwords unencrypted. If you set up a nonadmin user account, perhaps called Transfers, for the sole purpose of moving files around, the password issue shouldn't be much of a problem. Firewalls, on the other hand, are something you might need to discuss with your network administrator before you activate FTP.

You will learn how to use FTP from the Finder in the next section.

Sams Teach Yourself Mac OS X Digital Media. All In One
Sams Teach Yourself Mac OS X Digital Media All In One
ISBN: 0672325322
EAN: 2147483647
Year: 2003
Pages: 349 © 2008-2017.
If you may any questions please contact us: