Chapter 2. Using Your Network

In This Chapter

  • Finding out what you can do with your network

  • Sharing your files and printers with other Macs

  • Sharing your files with Windows computers

  • Accessing files on Windows computers

  • Configuring the built-in firewall

  • Remote-controlling your MacBook from afar

Here's one of those incredibly complex concepts that you always find in these computer books: After you have your network all set up and ready to go, you can do all kinds of things with it. (Now wasn't that utterly painless?) You can use your network to share files, share printers, remotely control your MacBook, share music across your network using iTunes, or even play multiuser games against friends. To keep your files safe from unwanted snoops, you can configure the Mac OS X built-in firewall. In this chapter, I cover the basics of file sharing, sharing printers, and using the firewall to protect yourself from intruders.

It's All about (File) Sharing

One of the main reasons for building a network is sharing files between computers. You might even want to set up a server, which is a computer with shared files that are always available to anyone on the network. Think of a server as a common file storage area for the rest of the network. Really, any computer that shares files is technically a server because it's serving, so to speak. But most people use the word server only to mean a computer that's dedicated solely to serving files, printers, and so on for the rest of the network.

Creating an account

Sharing files on your MacBook with other Mac users is a piece of cake. Remember, however, that you need to create an account for anyone whom you want to have access to your files. The accounts that you create can access only three folders, as shown in Figure 2-1:

The location of user folders and the Shared folder on your hard drive.

Figure 2.1. The location of user folders and the Shared folder on your hard drive.

  • The account's Home folder: That specific account's Home folder carries a short version of the username that's in the Users folder on your hard drive. Figure 2-1 shows the Home folder, which is noted with an icon that looks like a house, for the mark account (where mark is the short account name for Mark Chambers). The Home folder icon always bears the short account name for the user who's currently logged in.

  • The account's Public folder: Each user account you create also has a Public folder located within its Home folder. Any files you place in the Public folder can be accessed by any user on your Mac.

  • The Shared folder: This folder is also in the Users folder on your hard drive. Anyone with an account on your Mac can access the Shared folder, so it's a great place to keep common files that everyone wants to copy or use.

To create an account, you need to be logged in as an Admin user. Follow these steps:

  1. Open System Preferences from the Apple menu (

    The location of user folders and the Shared folder on your hard drive.
  2. Click the Accounts icon.

  3. Click the New Account button, which carries a plus sign.

  4. Fill in the appropriate information, including the name for the account and a password.

    Note that the name that appears as the short name determines the name of that user's Home folder.

  5. Click Create Account.

  6. Press

    The location of user folders and the Shared folder on your hard drive.

I cover creating accounts in greater detail in Book III, Chapter 5, but that's the short version.

Enabling file sharing

When you enable file sharing, your files are exchanged over Transmission Control Protocol/Internet Protocol (TCP/IP).

Follow these steps to turn on sharing:

  1. Open System Preferences.

  2. Click the Sharing icon to open the Sharing Preferences pane.

  3. Select the File Sharing check box to enable it.

Connecting to a shared resource

At the top of the Sharing pane, you can see that other Macintosh users can access your laptop at afp://<ip address>, where ip address is the IP address for your specific computer. When another Mac user wants to connect to your shared files, that person can do the following:

  1. Choose Go

    Connecting to a shared resource
  2. After the Connect to Server dialog opens, other Mac users can type afp://<ip address> (where ip address is the IP address of your MacBook) and then click the Connect button.

Tip

You can also browse for a shared resource in the Connect to Server dialog. Choose Go

Connecting to a shared resource

Give the username and password that you created to the person using the other Mac, and he or she can now access files in that account's Home folder as well as any other Public folders on your computer.

The sidebar that appears in Finder windows offers a Shared heading. Click the arrow next to Shared to display other shared resources on your network, just as if you had clicked Browse from the Connect to Server dialog. (I'm starting to think Snow Leopard might be a synonym for convenience.)

Sharing a Connected Printer

Sharing your printer for others to use is one of the best reasons to have a network. Setting up your MacBook to share your printer is very easy under Mac OS X. Here's a quick rundown of what you need to do:

  1. Open System Preferences.

  2. Click the Sharing icon under the Internet & Network section to open the Sharing Preferences pane.

  3. Click the Printer Sharing check box to enable it.

    Tip

    By default, when you turn on Printer Sharing, Snow Leopard automatically shares all the current printers connected to your MacBook. To select which printers can be used for shared printing, click the Print & Fax icon in System Preferences. From this pane, you can enable and disable sharing on individual printers.

After Printer Sharing is enabled, follow these steps to connect to that printer from other computers on your network:

  1. Click System Preferences in the Dock.

  2. Click the Print & Fax icon.

  3. Click the Add button (which carries a plus sign).

    Tip

    You might be prompted to add a printer automatically when the Printer Setup Utility opens. Click the Add button to begin the addition. (For more on adding a printer with the Printer Setup Utility, see Book VIII, Chapter 4.)

  4. From the Browser window that opens, click the Default button on the toolbar.

  5. Click the shared printer you want to use and then click the Add button.

Tip

Already have the Printer Browser open? Then follow the easier path: Clicking the Default toolbar button displays all the available local shared printers. Click the desired printer and then click Add.

Sharing Files with Windows Computers

If you've deigned to allow PCs running Windows on your network (a generous gesture), you'll probably want to also share files with those computers. Sharing files with a Windows PC — actually a Windows user — is very similar to sharing files with other Mac users.

Note

File sharing must be enabled, as I demonstrate earlier in this chapter. (When you share with other Macs, you're also making those files available to PCs.)

To allow file sharing with Windows computers, follow these steps:

  1. Click the System Preferences icon in the Dock.

  2. Click the Sharing icon to open the Sharing Preferences pane.

  3. Click the File Sharing entry.

  4. Click the Options button.

  5. Click the user account (or accounts) that will be accessible by Windows PCs.

    Tip

    Snow Leopard will growl while you try to enable SMB sharing. That's because you have to enable Windows access on the desired account before it can be used. Snow Leopard prompts you for your password, smugly informing you that the account password will be stored "in a less secure manner." (Take that, Mr. Gates!) Generally, this isn't a problem, but never enable an account for Windows access unless only trusted individuals will use it.

  6. Click the Share files and folders using SMB check box to enable it.

  7. Click Done to exit the Advanced dialog, and close the System Preferences window to save the changes.

Accessing File Shares on Windows Computers

If you allow a Windows PC to access your files, you'll also probably want to putter around with files on a Windows PC. Easy!

Accessing files on Windows computers relies on the Samba component (a part of the UNIX foundation of Mac OS X). Follow these steps:

  1. Choose Go

    Accessing File Shares on Windows Computers

    The Connect to Server dialog opens.

  2. In the Address box, enter smb://<ip address>, where ip address is the IP address of the Windows computer that you want to connect to.

  3. Click the Connect button.

    Depending on the type of account you have on the Windows PC, Mac OS X might display an SMB (Server Message Block) authentication dialog in which you can enter your username and password. (Think security for the Windows crowd.)

  4. Select the desired shared drive to mount from the pop-up menu.

  5. Mount the shared drive according to the Windows version:

    • If you're accessing a file shared on a Windows 95 or Windows 98 computer: Simply click OK to mount the share.

    • If you're accessing a file shared on a Windows NT, 2000, XP, or Vista computer: Click the Authenticate button. Then enter your username and password, click OK, and then click OK again to mount the share.

After you mount the shared drive, you'll see it appear on your Desktop, just as you see a Mac volume. You can use this drive just as you do any other drive on your system. To disconnect from the Windows share, you can

  • Drag the icon to the Trash in the Dock (which changes to an Eject icon when you start dragging).

  • Press

    Accessing File Shares on Windows Computers

    or

  • Right-click the icon (tap with two fingers on the trackpad) and then choose Eject from the menu that appears.

Using FTP to Access Files

FTP is part of the TCP/IP protocol suite ( the hoary acronym FTP stands for File Transfer Protocol. FTP is one of the oldest methods for sharing files between computers; however, because it's part of the TCP/IP protocol suite, it can be used on many different kinds of computers, including those running just about any type of strange and arcane operating system. You can still manage to exchange files regardless of whether you're using Mac OS X, Windows, Linux, or UNIX. (Heck, even dinosaurs like DOS can join the party.)

FTP is a client/server application. In plain English, this means that two pieces make things tick: the server (which hosts the connection, rather like a file server) and the client (which connects to the server). Mac OS X, thanks to its UNIX foundation, has both an FTP server and client built in. To use FTP, you need a computer running the FTP server software to give others access to files; then the other computer, or client, can connect to the FTP server. After the connection is made, the client can either send files to the server (uploading) or get files from the server (downloading). In this section, I cover how to use FTP to give others access to your files as well as talk about the FTP applications that come with Mac OS X.

Using the Mac OS X built-in FTP to share files

One way to give others access to your files is to run an FTP server on your MacBook. Mac OS X comes with an FTP server built in, so you just have to activate it. You might wonder why you'd use FTP to share files when you can use Personal File Sharing or Windows File Sharing. The main advantage to FTP is compatibility: Not only can people on your LAN access files, but anyone on the Internet can also access your files, regardless of the type of machine they're using.

Just as you do with the other file-sharing methods, you need to create a user account on your computer before someone can connect to and get files from your MacBook. After you have accounts created for the users, you can enable FTP sharing like this:

  1. Click the System Preferences icon in the Dock.

  2. Click the Sharing icon to open the Sharing Preferences pane.

  3. Click the File Sharing entry.

  4. Click the Options button.

  5. Click the Share Files and Folders Using FTP check box to enable it.

    Always helpful, Snow Leopard reminds you on the Advanced sheet that people can use ftp://<ip address>, where ip address is the IP address of your Mac.

  6. Click Done to exit the Advanced dialog, and close the System Preferences window to save the changes.

Tip

If you're using an AirPort/AirPort Extreme Base Station or other cable/digital subscriber line (DSL) router to share your Internet connection, place the Mac that you want people on the Internet to access in a DMZ, or demilitarized zone. Check your cable/DSL router documentation for more information.

Using FTP from Terminal to transfer files

You can use FTP to transfer files with an FTP server by using the command-line interface (CLI); to use the CLI, open a Terminal, or shell, session. To use a Terminal session, double-click the Terminal icon in the Utilities folder inside the Applications folder. When you open a Terminal session, you're presented with a window that accepts text commands. You'll see a prompt that consists of your computer's name and the folder that you're currently in, followed by your user ID. It's at this prompt where you type various FTP commands.

After you're in the Terminal session, you'll use a series of commands to connect to another computer, move in and out of folders, and transfer files. Following is a list of the basic commands that you need to use FTP as well as a brief description of what each command does.

  • ftp: This command starts the FTP command-line interface session. You can tell that you're in the FTP client application when you see ftp> as your command prompt. This is where you type all other FTP commands to do things.

  • open: This command is used to start your connection to another computer. Type this command followed by the IP address of the FTP server that you want to connect to.

  • ls: Use this command to see a listing of all files and folders in the current folder on the FTP server.

  • cd: This command allows you to change the folder that you're in. Type cd <folder> (where folder is a specific folder name) to move into a subfolder on the FTP server. Type cd .. (that's c, d, space, and two periods) to go back out a folder level.

  • lcd: This command acts exactly like cd except that it changes the folder that you're currently in on your local system, not the FTP server. Use this command to put yourself in the folder on the local drive that you want to transfer files to and from.

  • bin: Type this command to get in binary mode to transfer files that aren't plain-text files. (Always use binary mode unless you're specifically transferring plain-text files.)

  • ascii: This command puts you in ASCII mode for transferring text files.

  • get or mget: To retrieve a single file, use the get command followed by the filename of the file that you want to retrieve. If you want to get multiple files at one time, use the mget command followed by a filename, possibly containing * and/or ? as wildcards.

  • put or mput: To send a single file, use the put command followed by the filename to send a file to the FTP server. To send multiple files, use the mput command followed by a filename, possibly containing * and/or ? as wildcards.

  • quit: Use the quit command to end your FTP session.

To end a Terminal session and exit Terminal at any time, press

Using FTP from Terminal to transfer files

Tip

Many FTP servers will let you send files only to certain folders. Most times this folder is named Upload, Uploads, or something similar.

Using these commands will enable you to exchange files with an FTP server. Here's an example of how to use these commands within the Terminal window:

  1. Type ftp to get into FTP mode.

  2. Type open <ip address> (where ip address is the server's network IP address) to open your connection to the FTP server.

  3. At this point, you're asked for a username and password.

    For many FTP servers, using the username anonymous and your e-mail address as the password is enough to get you logged in. Some sites even allow you to log in without any username or password at all. On secure sites, however, you must use an assigned username and password provided by the administrator of that particular server.

  4. Type lcd <folder> (where folder is a specific folder name) to change into the folder on your local drive that you want files to come to or from.

  5. Type the ls and cd commands to place yourself into the desired folder on the FTP server.

  6. Type the ascii or bin command to set your file transfer mode to ASCII or binary, respectively.

    Warning

    This is important because choosing the wrong type will likely cause the transfer to fail. Unless it's a plain-text file, always use binary mode.

  7. Type the get, mget, put, and mput commands to send or receive the desired files.

  8. Type the quit command to close the connection and exit the FTP session.

Using the Built-in Firewall

A firewall watches all the network communications coming into your MacBook. It automatically plays the role of security guard, blocking or denying certain network traffic that you want to prevent from reaching your laptop. It acts as another layer of security to help keep you safe from unwanted attacks. That's all well and good, but you must be careful to set up your firewall correctly before you turn it on: A configuration mistake could make your MacBook inaccessible from the network.

For instance, if you want to enable FTP access on your MacBook but you also want to keep all other traffic from coming into your system, you can tell the built-in firewall to allow only FTP traffic. The firewall on the MacBook will block or allow only TCP/IP traffic — not Bonjour — so Bonjour traffic (which is always from your local network and not the Internet, anyway) can always get in.

When enabled, the firewall blocks all traffic that comes into your MacBook. By default, however, the firewall is turned off. So, your first job is to enable the firewall, which you can do by following these steps:

  1. Click the System Preferences icon in the Dock.

  2. Click the Security icon.

  3. Click the Firewall tab.

  4. Click the Start button to turn on your firewall.

  5. Click the Advanced button to show the settings that you see in Figure 2-2.

    You can help protect your MacBook by using Snow Leopard's built-in firewall.

    Figure 2.2. You can help protect your MacBook by using Snow Leopard's built-in firewall.

  6. Click the Automatically Allow Signed Software to Receive Incoming Connections radio button to select it.

This enables the firewall. And, by default, virtually all incoming TCP/IP traffic is blocked. You must enable each sharing method that you want to be able to use. When you enable different sharing methods from the Sharing pane in System Preferences (such as File Sharing or FTP Access), you'll notice that those types of traffic now appear in the Firewall list. (In other words, when you turn on a sharing method, the firewall automatically allows traffic for that sharing method, which Snow Leopard calls a service. Most excellent.)

Tip

Click the up/down arrow icon to the right of any service to specify whether the firewall should allow or block connections.

Sometimes, you might want to allow other traffic through your firewall that isn't on the firewall list of recognized services and applications. At that point, you can click the Add button (which bears a plus sign) to specify the application that your firewall should allow. Snow Leopard presents you with the familiar Add dialog, and you can choose the application that needs access.

Remote Control of Your MacBook

Forgive me whilst I wax techno-nerd here: One of the coolest advantages to a network is the ability to take control of one computer from another computer. For example, sometimes you might need to access files on your Mac Pro desktop while you're on a trip, but you don't have File Sharing enabled. What can you do? You can remotely connect into your Mac Pro and then — just as if you were sitting in front of it — enable File Sharing (as I demonstrate earlier in the chapter). Perhaps you have a file on your computer with someone's phone number that you suddenly need on the road. With remote control, it's at your fingertips! (Sigh ...ah, technology.)

Using Screen Sharing

Snow Leopard's Screen Sharing feature, which is available from iChat, can be turned on for individual users from the Sharing pane in System Preferences. You can allow access for all user accounts on your MacBook or limit remote access to selected users. Screen Sharing is Apple's implementation of Virtual Network Computing (VNC) technology.

To set up Screen Sharing, follow these steps:

  1. Click the System Preferences icon in the Dock.

  2. Click the Sharing icon to open the Sharing Preferences pane.

  3. Click the Screen Sharing check box to select it.

  4. To limit remote access for specific accounts, click the Only these users radio button, and click the Add button (which bears a plus sign) to select a user.

  5. Close the System Preferences window to save the change.

After you've enabled screen sharing, you can use the Buddies

Using Screen Sharing

Remotely control your MacBook (for free, no less!)

Virtual Network Computing (or VNC, available for many platforms at www.realvnc.com) is a very nice application that enables you to remotely control a computer from pretty much anywhere that has an Internet connection. VNC is easy to install and configure, and it runs on many different platforms, ranging from Windows XP and UNIX on desktop computers and servers to Palm OS and Windows CE on personal digital assistants (PDAs). Wrap your mind around this: You could be at a friend's house on her wireless network and use your PDA to remotely control your MacBook at home over the Internet. Pure, undiluted sassy!

Tip

Some networks have proxies and firewalls that might interfere with VNC's operation. You can remotely control a computer that's behind a firewall or cable/DSL router, but the firewall/router needs to be configured properly. Because the process varies from one manufacturer to the next, check your cable/DSL router manual for instructions on how to do this.

How VNC works

In a nutshell, VNC takes the graphical interface on your monitor, turns it into data, and sends it to the computer that you're using to remotely control it. The computer that you're using sends keyboard presses, trackpad movements, and clicks to it, acting just the same way as it would if you were sitting right in front of it.

Tip

As I mention earlier, you can use Snow Leopard's Screen Sharing feature in iChat to make a remote connection from another Mac to your MacBook. However, you're not limited to using just another Mac using Snow Leopard and Screen Sharing in iChat — you can control your MacBook from a Windows PC, or from an older version of Mac OS X as well! If you've already enabled Screen Sharing (as I demonstrate earlier in this chapter), follow these steps to enable any VNC connection:

  1. Click the System Preferences icon in the Dock.

  2. Click the Sharing icon to open the Sharing Preferences pane.

  3. Click the Screen Sharing entry.

  4. Click the Computer Settings button.

  5. Click the VNC Viewers May Control Screen with Password check box to select it.

  6. Click within the password text box and enter a password for VNC applications.

  7. Click OK to exit the Computer Settings sheet, and close the System Preferences window to save the changes.

Figure 2-3 shows a screenshot of a Mac running Mac OS X Tiger being remotely controlled from a computer running Windows 98. (Yes, I know, it's a travesty, but then again, sometimes you've just gotta use what you've got.)

Yes, bucko, that's Mac OS X accessed remotely via Windows!

Figure 2.3. Yes, bucko, that's Mac OS X accessed remotely via Windows!

Warning

Mr. Paranoia speaks again: Make doggone sure that you set up the password access correctly for VNC or don't run it! I can't stress enough how much fun a hacker would have with free remote control over your Mac OS X Desktop.

Remote control of another computer from your MacBook

A few different VNC viewers exist for Mac OS X. A VNC viewer is just an application you use to remotely control another computer running VNC. You can download them at www.realvnc.com/download.html. If you find yourself on a computer without a VNC viewer — heaven forbid — VNC server actually runs over the Web as well! As long as the computer that you're using has a Web browser that supports Java — which Safari does — you can still remotely control your computer.

When you connect to the computer running VNC using a Web browser, the Web server sends a default page that contains a Java applet. That Java applet asks you for the password to connect; upon entering the correct password, it brings up the remote control session right in the Web browser.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.15.15