Chapter 2

Using Your Network

In This Chapter

arrow Finding out what you can do with your network

arrow Sharing your files and printers with other Macs

arrow Sharing your files with Windows computers

arrow Accessing files on Windows computers

arrow Configuring the built-in firewall

arrow Remote-controlling your Mac

Here’s one of those incredibly complex concepts that you always find in these computer books: After you have your network set up and ready to go, you can do all kinds of really cool things with it. (Highly technical.) You can use your network to share files, share printers, remotely control your Mac, or even play multiuser games against friends. To keep your files safe from unwanted snoops, you can configure the OS X built-in firewall. In this chapter, I cover the basics of file sharing, printer sharing, 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 Mac with other Mac users is a piece of cake. Remember, however, that you need to create an account for anyone that you want to have access to your files. Each person assigned an account is called a user. By default, the user accounts that you create can open and save files in the location shown in Figure 2-1 (as well as in external hard drives and USB flash drives).

9781118990896-fg3501.tif

Figure 2-1: The location of user folders and the Shared folder on your hard drive.

These are the three folders:

  • The account’s Home folder: The specific account’s Home folder carries a short version of the username 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, Guest is the Guest account Home folder and ben is the Home folder for one of my example users). (If you create a Sharing Only account — see Book II, Chapter 5 — Yosemite doesn’t create a Home folder for that account.)
  • Each account’s Public folder: Each admin, standard, or managed 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, local or remote. (Again, Sharing Only accounts don’t have a Public folder.)
  • The Shared folder: This folder is also in the Users folder on your hard drive. Anyone with an admin-level account on your Mac can access the Shared folder across the network, and any user account on your Mac can access the Shared folder locally, so it’s a great place to keep common files that everyone wants to copy or use.

    tip.eps If you create a Sharing Only account, the user of that account can use only the contents of the Shared folder. (Go figure.)

To create an account, you need to be logged in as an admin user. I cover creating accounts in greater detail in Book II, Chapter 5, but here’s the short version:

  1. Open System Preferences from the Apple menu (9781118990896-app.tif) or the Dock.
  2. Click the Users & Groups icon.
  3. Click the New User button, which features a plus sign.

    If the New User button is dimmed, you need to unlock the Users & Groups pane first. Click the padlock icon in the lower-left corner, type your admin user account password, and click Unlock.

  4. Open the New Account pop-up menu, and choose the account type.

    Your choices are Administrator (Admin), Standard, Managed with Parental Controls, and Sharing Only.

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

    remember.eps The name that appears as the short name determines the name of that user’s Home folder.

  6. Click Create User.
  7. Press maccmd.png+Q to exit System Preferences.

Enabling file sharing

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

technicalstuff.eps As I discuss in more dry detail in Chapter 1 of this minibook, TCP/IP is a protocol suite used for Internet data transfer.

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 turn on File Sharing.

tip.eps This method provides the default system of file sharing, where your account’s Public folder is accessible to all users. You can give other users access to additional folders on your Mac by clicking the Add button (with the plus sign) under the Shared Folders list.

Connecting to a shared resource

At the top of the Sharing pane, you can see that other Macintosh users can access your computer 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. From the Finder menu bar, choose Go⇒Connect to Server.

    The Connect to Server dialog opens.

  2. In the Server Address box, type afp://<ip address> (where ip address is the IP address of your Mac) and click the Connect button.

tip.eps You can also browse for a shared resource in the Connect to Server dialog. Choose Go⇒Connect to Server or press maccmd.png+K, and click Browse to locate the shared computer. You might be prompted to choose whether you want to connect as a guest or a registered user. To connect to the server as a registered user, you must supply the username and password. If you connect as guest, you don’t have to supply a password, but your access is restricted to only the Public folder for each account on the system to which you connect. If you need to connect as a registered user, ask an admin user who controls that Mac to supply you with the username and password.

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. (If nothing is listed under the Shared heading, click the Show button next to it.) The Shared heading displays other shared resources on your network, just as if you had clicked Browse from the Connect to Server dialog. (I’m starting to think Yosemite might be a synonym for convenience.)

Sharing a Printer Connected to Your Mac

Sharing that snazzy printer connected to your Mac with others is one of the best reasons to have a network. Setting up your Mac to share your printer is easy under OS X. Here’s a quick rundown of what you need to do:

  1. Open System Preferences.
  2. Click the Sharing icon to open the Sharing Preferences pane.
  3. Select the Printer Sharing check box.

    remember.eps By default, when you turn on Printer Sharing, Yosemite automatically shares all the current printers connected to your Mac. To select which printers can be used for shared printing from the Sharing pane, select the check box next to each printer: That is, select the check box to share that printer, or deselect it to block others from using it. (Alternatively, you can click the Print & Scan icon in System Preferences. From this pane, you can also enable and disable sharing of 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 on the Dock.
  2. Click the Printers & Scanners icon.
  3. Click the Add button (plus sign) under the Printers list at the left side of the pane.

    If the Add button is disabled, click the padlock icon in the lower-left corner, type your admin user account password, and click Unlock.

    If you’re 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 VII, 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.eps 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 access to your network (a generous gesture indeed), you’ll probably want to also share files with those computers. Sharing files with a Windows PC — actually a Windows user — is similar to sharing files with other Mac users.

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

  1. Click the System Preferences icon on the Dock.
  2. Click the Sharing icon to open the Sharing Preferences pane.
  3. Click the File Sharing entry.
  4. Click the Options button to display the Options sheet.
  5. Select the Share Files and Folders Using SMB check box.
  6. Select the On check box next to the user account (or accounts) that will be accessible by Windows PCs.

    tip.eps Yosemite growls while you try to enable SMB sharing because you must enable Windows access on the desired account before it can be used. (SMB is short for Server Message Block, which is a file-sharing protocol used by Windows.) Yosemite prompts you for your password, smugly informing you that the account password will be stored “in a less secure manner.” Generally, this isn’t a problem, but never enable an account for Windows access unless only trusted individuals will use it.

    tip.eps If your Windows users have problems browsing for your Mac on your network, you can provide them the Mac’s specific SMB address to make things easier — it’s boldly displayed in the File Sharing section of the Share Preferences pane.

  7. Click Done to exit the Options sheet, and close the System Preferences window to save the changes.

Accessing File Shares on Windows Computers

Fair is fair: If you allow a Windows PC to access your files, you also probably want to putter around with files on that Windows PC. Easy!

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

  1. From Finder, choose Go⇒Connect to Server.

    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 to which you want to connect.

    Don’t forget that you can also use the Browse button to search for Macs and PCs with shared files on your network.

  3. Click the Connect button.

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

  4. Choose the desired shared folder or drive to mount from the pop-up menu.
  5. Mount the shared folder or drive according to the Windows version:
    • If you’re accessing a file shared on a Windows 98 or Me computer: Simply click OK to mount the share.
    • If you’re accessing a file shared on a Windows 2000, XP, Vista, 7, or 8 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 location, you’ll see it 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 do one of the following:

  • Drag the icon to the Trash on the Dock (which changes to an Eject icon when you start dragging).
  • Press maccmd.png+E.
  • Right-click the icon, and choose Eject from the menu that appears.

Using FTP to Access Files

FTP — File Transfer Protocol — is part of the TCP/IP protocol suite. 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 OS X, Windows, Linux, or Unix. (Heck, even dinosaurs like DOS can join the party.) FTP transfers are also faster than downloading the same file from a web server.

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, and which you control). OS X, thanks to its Unix foundation, has an FTP 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 access files on a server.

You can use FTP to transfer files with an FTP server by using the command line interface, in a Terminal (or shell) session. I discuss Terminal and the Unix command line in detail in Book VIII, Chapter 2.

Start by clicking the Spotlight icon on the Finder menu bar. Type terminal into the Spotlight Search box, and press Return to launch the application. (Or, from a Finder window, 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 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 use a series of commands to connect to another computer, move in and out of folders, and transfer files.

tip.eps Many FTP servers limit you to sending files only to certain folders. Most times this folder is named Upload, Uploads, or something similar.

Here’s a list of the basic commands 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. The command prompt 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 to which you want to connect.
  • 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 you’re in. Type cd <folder> (where folder is a specific folder name) to move to a subfolder on the FTP server. Type cd .. (that’s cd, 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 move to 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. Important: 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 maccmd.png+Q. Terminal prompts you for confirmation if necessary.

Here’s an example of how to use these commands in the Terminal window:

  1. In Terminal, 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. Enter your username and password.

    For many FTP servers, using the username anonymous and your email 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.eps 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 receive or send the desired files.
  8. Type the quit command to close the connection and exit the FTP session.

tip.eps If you’d rather use a drag-and-drop graphical client application for transferring files using FTP, I recommend the freeware FileZilla application (available at http://filezilla-project.org).

Using the Built-in Firewall

A firewall watches all the network communications coming into your Mac. It automatically plays the role of security guard, blocking (denying) certain network traffic that you want to prevent from reaching your Mac. 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 because a configuration mistake could make your Mac inaccessible from the network.

For instance, if you want to enable screen sharing on your Mac (which I discuss in the next section) but you also want to keep all other traffic from coming into your Mac, you can tell the built-in firewall to allow only screen sharing. The firewall on the Mac follows the rules you set up on what to block or allow.

warning.eps If your network already has either a hardware or software firewall in place — for example, a built-in firewall on your router or Internet sharing device — turning on your OS X Yosemite firewall can result in conflicts or stability problems.

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

  1. Click the System Preferences icon on the Dock.
  2. Click the Security & Privacy icon.
  3. Click the Firewall tab.
  4. Click the Turn On Firewall button to turn on your firewall.

    Is the Turn On Firewall button disabled? Don’t panic! Just click the padlock icon in the lower-left corner, type your admin user account password, and click Unlock.

    This step enables the firewall. And, by default, virtually all incoming TCP/IP traffic is blocked.

  5. Click the Firewall Options button to show the settings that you see in Figure 2-2.
    9781118990896-fg3502.tif

    Figure 2-2: You can help protect your Mac by using Yosemite’s built-in firewall.

  6. Select the Automatically Allow Signed Software to Receive Incoming Connections check box.

    As I mention earlier, you must enable each sharing method that you want to be able to use. However, when you enable different sharing methods from the Sharing pane in System Preferences (such as File Sharing or Screen Sharing), 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 Yosemite calls a service. Most excellent.)

    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. Yosemite presents you with the familiar Add dialog, and you can choose the application that needs access.

  7. Click OK to save your changes and return to the Security & Privacy pane, and then click the Close button to close the System Preferences window.

Remote Control of Your Mac

Forgive me whilst I wax techno-nerd here: One of the coolest advantages to a network is the capability to take control of one computer from another computer. For example, sometimes you might need to access files on your Mac 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 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.)

tip.eps Remote control is also a godsend if you have a tech-savvy family member or friend. You can invite that invaluable person to connect to your Mac and demonstrate a procedure in Pages, or even help configure some of the more complex settings in System Preferences!

Yosemite’s Screen Sharing feature, which is available from Messages, can be turned on for individual users from the Sharing pane in System Preferences. You can allow access for all user accounts on your Mac 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 on the Dock.
  2. Click the Sharing icon to open the Sharing Preferences pane.
  3. Select the Screen Sharing check box.
  4. To limit remote access for specific accounts, select the Only These Users radio button and click the Add button (a plus sign) to select a user.
  5. Close the System Preferences window to save the change.

After you enable screen sharing, you can use the Buddies⇒Share My Screen menu item in Messages to share your screen with another person. To view another person’s screen, use the Buddies⇒Ask to Share Remote Screen menu item. (For the details on Messages and Screen Sharing, see Book V, Chapter 3.)

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

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