Chapter 10: Accessing Files over a Network


Viewing Web pages over the Internet is just one type of network service that you can access with your computer. Just as the Internet is one way of obtaining information and viewing files, so is file sharing over a network and the Internet. Using different types of connection protocols and interfacing with Mac, Windows, and Internet servers, your Mac can connect to an abundance of devices and trade files back and forth between them all. This Chapter explains first how to access files from other people’s machines, how to use Mac OS X’s keychains to keep track of all your passwords for you, and finally how to set up your own Mac for sharing files so that other users can get them from you.

Accessing Files

The sharing part of file sharing implies a give-and-take scenario. On a network, and over the Internet, you can take and use files from other people’s computers, and, if you set your computer to allow it, they can do the same from you. Computers that provide files and storage space are known as file servers. A file server is said to be a dedicated server when it’s a computer that is not used for personal work. Its primary job is to share files. A file server can also be someone’s personal computer (also called a workstation) that, aside from being used for regular work, is set up to share its files with other network computers. For files to be moved between the machines, a specific client-server protocol must be used. These protocols are the language with which different hardware and different operating systems can speak to each other. Mac OS X supports quite a few of them. All are accessible through the Finder.

Apple has had its own file sharing protocol called AFP, or Apple Filing Protocol. Macintosh file servers use the AFP protocol. The address of an AFP server begins with afp://.

Windows servers typically use the SMB (Server Message Block) or CIFS (Common Internet File System) protocols for file sharing. Your Mac can connect to these without issue. Windows file server addresses usually begin with smb://.

Sharing files over the Internet is often done through FTP, or File Transfer Protocol. ftp:// at the beginning of a server address designates it as an FTP server.

Other protocols that are supported in OS X include WebDAV and NFS. WebDAV stands for Web-based Distributed Authoring and Versioning, and is usually used in Web server applications where live changes need to be made to online material. NFS stands for Network File System, and is the native file sharing protocol that Unix uses.

The great thing about OS X is that Apple has made connecting to all these different kinds of servers and protocols extremely uniform in method. While specific messages and dialog boxes might be different, the basics are the same. To use any of these kinds of file servers or protocols, all you need is the Finder. With the Finder, you can connect to a file server, mount server volumes, see your access privileges on the server volumes, and copy files. You can also use the Finder to open files from a server, or you can open server files directly from within other applications. When you’re finished using a server, you use the Finder to disconnect from it.

Tip

You can also connect to AFP and FTP shares by typing their addresses into the address field in Safari. When you hit the return key to connect, Mac OS X brings you an authentication dialog box, just as if you connected through the Finder.

Connecting to a file server

In previous versions of Mac OS X, the only way to connect to a server was to pull down the Finder’s Go menu, and choose the Connect to Server option (z-K). This presents you with a dialog box in which you can both browse the network for local servers, or type an address and connect to a remote one. Puzzling to many people was that there was a “Network” globe visible at the Computer level of the Finder, which seemed as though it would be a convenient way to browse the local network. This was true in special circumstances only (when in the presence of a NetInfo server) and was often left unused.

In Mac OS X 10.3, Apple separates the methods for connecting to servers. The Connect to Server dialog box still exists, but it is mainly for specifying a known or remote server. Local servers are now accessible through the Network globe in the Finder, as it was commonly assumed in previous OS X versions. If you are in the Connect to Server dialog, you can hit the Browse button to open a new Finder window with the Network globe selected. Designating a server as local merely means that it is part of your network. The usual side-effect of this is that a local server will be visible when browsing for servers; you don’t have to specify its location. A remote server, however, will not show up when browsing, and its location must be specified. Yes, it is possible to connect “remotely” to a local server by using the Connect To Server box and not browsing, but for our purposes, local servers will be accessed through the Finder’s Network icon and remote servers will be accessed by choosing the Connect To Server command. Choosing the Connect to Server option from the Go menu presents you with the dialog box shown in Figure 10-1.

click to expand
Figure 10-1: Your journey to a file server connection begins with this box.

Connecting remotely

The main idea here is to type in the address of a server and hit the Connect button to engage. If you want to view the servers that are available locally, click the Browse button. Although there are a bunch of different servers that you can connect to, the basic way in which you do so is the same. The following list is a breakdown of the elements found within the Connect to Server box:

  • Server Address: This is the field in which you specify the location of your server. Just as you type in a URL for connecting to a Web site through Safari, you also must type in a URL to connect to a server. A Web site is specified by its http beginnings. When connecting to a file server, instead of specifying the hypertext transfer protocol, you need to specify a files sharing protocol, like FTP. For example, take the server at address 192.168.1.3. It is possible for this machine to have services active for connecting over many different protocols. The URL that you type in (for example ftp://192.168.1.3 for an FTP connection) is what specifies which service to connect to.

  • Add to Favorites: The Add to Favorites button (the button with the plus sign) is used to save server addresses for future connection. Essentially, you are bookmarking the address, just as if you were bookmarking a Web site. If you are about to connect to a server and feel that you will want to visit it later, click the plus sign to add it to your list of favorite servers. Doing so also places a double-clickable file in your Favorites folder that you can launch to reconnect as well.

    Note

    If your Mac has file sharing turned on, you see your Mac listed as one of the file servers on the network. If you try to connect to it, Mac OS X will politely tell you that you need to access those files locally and not over the network.

  • Recent Servers: Clicking on the Choose a Recent Server button (the button with a clock face icon) pulls down a list and displays the servers to which you have recently connected. The Mac OS saves your recent connections so you don’t have to. If you have never connected to a server before, the list will be empty.

  • Favorite Servers: In this portion of the window is a list of the servers that you saved by clicking on the Add to Favorites button. Clicking on an item in the list will place its address into the address field.

  • Remove: Clicking the Remove button removes a selected favorite from the favorites list.

  • Browse: Use the Browse button if you don’t know the address of the server that you want to connect to, or if you just want to view all of the servers that are available over the network. Clicking on the Browse button takes you to a new Finder window within the network.

  • Connect: Click the Connect button to initiate your connection to the server.

In all cases, if the address is valid and the server is online, after you hit the Connect button, you are presented with another dialog. This box confirms that a connection has been achieved, and has places for entering your name and password so that you can authenticate to the server. Depending on whether you are connecting to an AFP, FTP, or SMB volume, the box will look slightly different. In any case, the end goal is to access the files of these volumes from within the graphical interface of the Finder. Ahead, we look at the different possibilities.

start sidebar
Connecting to AppleTalk File Servers

Mac OS X normally uses the TCP/IP protocol to communicate with AppleShare file servers and file-sharing computers. However, many AppleShare file servers still use the AppleTalk protocol that was the standard for Mac file servers during the 15 years prior to Mac OS X. Beginning with Version 10.1, Mac OS X can use both TCP/IP and AppleTalk for file servers and file sharing. But Mac OS X does not use AppleTalk unless it was activated when your computer was set up for a network. If you don’t see AppleTalk listed above Local Network in the Connect to Server dialog, then you need to activate AppleTalk before you can connect to file servers and file-sharing computers that use it. You make AppleTalk active in the Network pane of System Preferences, as described in Chapter 15.

The AppleTalk address of a file server is different from a TCP/IP address, because AppleTalk identifies file servers by name. If a file server’s AppleTalk name includes spaces or symbols, these elements have to be encoded in the Address box of the Connect to Server dialog. For example, the AppleTalk address of a file server whose name is Aphrodite’s G4 would appear as afp:/at/Aphrodite%d5s%20G4 in the Address box. The code %d5 stands for an apostrophe, and the code %20 stands for a space. (These codes are based on ASCII code of the character, expressed as a hexadecimal number.)

Note that the AppleTalk address of an AppleShare file server or file-sharing computer begins with afp:/ protocol identifier. This is similar to the afp:// protocol identifier that begins the TCP/IP address of an AppleShare file server. However, the AppleTalk address has only one slash after the colon.

end sidebar

start sidebar
Connecting to AppleTalk-TCP/IP File Servers

Some file servers can communicate using AppleTalk and TCP/IP at the same time. This is referred to AFP over IP meaning that Apple’s filing protocol is traveling over the TCP/IP protocol. Anytime you type in an address that begins with afp://, this will be the case. You need both AppleTalk and TCP/IP to be active in order to connect to one of these servers on a network; without AppleTalk active, the servers usually will not be visible while browsing. Without TCP/IP active, your Mac will not connect, and will display an error message when you try.

end sidebar

AFP connections

After typing in the URL of the Apple File Protocol server that you want to connect to, and hitting the Connect button, you are presented with an untitled dialog box that prompts you to connect either as a guest or a registered user of the server, as shown in Figure 10-2.

click to expand
Figure 10-2: Establish your identity as a guest or registered user of a file server.

To connect as a registered user, select the Registered User option and enter your registered name and password in the dialog. To be a registered user means that the owner of the server has set up a user account for you with the proper access privileges, and assigned this name and password to you. If your own computer is set up as a file server (later in this Chapter) and you’re connecting to it from another computer, enter your Mac OS X account name and password. When you enter your password, you must type it exactly right, including uppercase and lowercase letters. (It’s case-sensitive.) Then click OK.

Enabling people to log in as a guest user means that anyone, including those without a user account and a password, can log into the server and access certain files. If you’re not a registered user and the Guest option isn’t disabled (grayed out), you can select the guest option to connect that way. However, guests usually have far fewer privileges on a file server than registered users. If the Guest option is disabled, guests are not permitted to access the file server. If you don’t have a registered name and password for the file server, ask its owner to give you one.

Setting preferences for file server connections

While identifying yourself as a registered user or guest, you have the opportunity to set some preferences concerning the handling of your password and your connection. Clicking on the Options button shown in Figure 10-2 presents you with another dialog box, shown in Figure 10-3. This dialog provides you with a number of options. You can change your password by clicking on the Change Password button. You are then asked to type in your old password once, and the new one twice, for confirmation. Clicking OK saves the new password. You can also decide whether you want the password added to your keychain, which saves you the trouble of entering them every time you connect to the server. Check the box next to Add Password to Keychain to do this. (The keychain is discussed in detail later in this Chapter.) If you click the Save Preferences button, the current settings become the default settings for future file server connections. Click OK to return to the identification dialog. Figure 10-3 shows the preference settings dialog.

click to expand
Figure 10-3: Set preferences for your password and your connection.

Selecting network volumes

After you hit the connect button from the identification screen, you see another dialog. This dialog tells you the name of the server to which you’re connecting and the various volumes on that server that you can mount, as shown in Figure 10-4.

Connecting as a registered user gives you the choice of any folders or volumes to which you have access as one of the following:

  • Any folders or volumes to which the owner or a member of the access group has access

  • Any folders or volumes to which everybody else has access

  • The Public folders of all other accounts on that Mac OS X machine

    click to expand
    Figure 10-4: Select the volumes you want to mount from the file server.

If you are connecting to your own machine, you will typically see two volumes available to you. One is the name of your hard drive; because you are its owner, you have full access to it. The other volume will be your user folder, which you are also the owner of. If the server allows Guest access and you choose to connect as a Guest, you’ll see a separate volume for each user that has a public folder. You’ll also see any folders or volumes specifically set up for Guest access. You can double-click on the volumes you want to mount or select them (z-click or Shift-click for multiple items) and hit the OK button. Servers connected to through the Connect to Server dialog will show up in the Finder’s sidebar, and mount on the desktop if you have your Finder preferences set that way.

After the volumes are mounted, you can treat them like any other disk, and begin working with the files. Refer to Chapter 3 for more discussion of access privileges, which are set through the Get Info windows in the Finder (or by Unix commands in the Terminal application).

Connecting to Microsoft Windows file servers

In a world dominated by Microsoft Windows (at least on the computing front), being able to access files on a Windows file server is important. Beginning with Mac OS X Version 10.1, you can use the Connect to Server dialog to connect to Microsoft Windows file servers. These include Windows NT file servers, Windows 2000 file servers, and Windows 98 computers with file sharing turned on.

A Windows server address gets entered in the Server Address box. The address of a Windows file server has the form smb://server/share/ where server is the name or IP address of the file server and share is the name of the volume or folder that you want to connect to. For example, the address smb://192.168.1.2/Public/ would connect to the Public folder of the Windows file server whose IP address is 192.168.1.2. If you use a file server’s name instead of its IP address, you may need to type the name in all capital letters. If you do not know the specific share, you can just type in the name or IP address of the server.

After entering the address of a Windows file server and clicking Connect in the Connect to Server dialog, another dialog appears in which you specify your workgroup or domain, username, and password on the Windows file server, as shown in the Figure 10-5. If you want to save your password, select the Add to Keychain option.

click to expand
Figure 10-5: The login screen for a Windows file server.

If any problems occur that prevent connecting to a Windows file server, an alert appears saying no file services are available at the address you specified. This message may indeed mean the Windows file server is not available. The message also occurs if you simply mistype the address, workgroup, username, or password. Note that Mac OS X 10.1 can’t connect to a Windows file server if the server name or share name includes any spaces, even if you encode them as %20, but 10.2 and 10.3 do not suffer from that ailment.

Connecting to an FTP server

On the Internet, files are commonly sent using File Transfer Protocol (FTP). A computer can make files available using this protocol by running a type of program called an FTP server. This term also refers to the combination of the server program and the computer that’s running it. You may sometimes hear people refer to an FTP site, which is a collection of files on an FTP server that are available for downloading. An FTP site has the same function on the Internet as a file server on your network.

In Mac OS X, you can connect to FTP servers directly from the Finder. For more advanced functionality you can use a program specially made for FTP transactions, called an FTP client. One such application is called Transmit, and is covered in Chapter 21.

An FTP server address goes into the server address field, just like AFP and SMB addresses. Hitting connect brings up the FTP authentication screen, where you’ll need to type in your name and password, as shown in Figure 10-6.

click to expand
Figure 10-6: The login screen for an FTP server.

When you log in successfully and hit the OK button, the Connect to Server box disappears and the FTP volume is mounted in the Finder, free for your perusal.

Tip

Because Mac OS X has full Unix underpinnings, you can use the command line to access FTP servers, by launching the terminal and using the FTP command.

Connecting locally

Local servers are servers that appear on your network without having to initially specify their location. Local servers are great because you can browse for their existence. You can browse for local servers directly from the Finder. If you are already in the Connect to Server dialog, clicking the Browse button opens a new Finder window, with the Network globe selected. All the servers that are accessible on your network will show up in the Network globe window. You can also access the Network globe directly by opening a new Finder window and clicking on it, or by selecting the Network option from the Go menu. Look at Figure 10-7 to see how browsing in the Finder looks.

click to expand
Figure 10-7: Browsing for local network servers. This network has one server available, called Silversides.

The Servers option that appears within the list of local servers designates the path for accessing NetInfo servers, which used to be the sole purpose of the globe.

Whichever Finder view you are in, (icon, list, or column) double-clicking on the server you wish to access immediately brings up a pared-down version of the Connect to Server dialog, (see Figure 10-8) with places for typing in your name and password only, and the option to connect as a guest. Clicking Connect brings you to a Finder window that serves the same purpose as Figure 10-4 shown earlier, which lets you view the volumes that you can access. When browsing and connecting locally, the volumes are available straight from a Finder window, and not a separate dialog box as when you connect remotely.

click to expand
Figure 10-8: The pared-down Connect to Server dialog that appears when you connect to a local server.

When you are in the column view, you can click once on a server to select. The preview icon contains a Connect button. Clicking Connect brings up the pared-down connect-to-server box, and after you are connected, the volumes of the server extend through the column view, as shown in Figures 10-9 and 10-10.

click to expand
Figure 10-9: Click the Connect button from the column view to access the server.

click to expand
Figure 10-10: The server volumes and their contents appear directly in the Finder.

Connecting with a favorite

When you are in the Connect to Server dialog, or after the volume is mounted and you are in the Finder, you can create a favorite from a server location for more streamlined connections in the future. Opening a server location from a favorite skips the Connect to Server box and takes you right to the identification screen. If your password is saved in the keychain, you don’t even have to type anything in. You can make a favorite by clicking the plus sign as discussed earlier in the Chapter, or by dragging the mounted server’s icon into your Favorites folder. The server favorites show up in the finder as documents, named with either the name or the IP address of its server. (See Figure 10-11.) These documents can be double-clicked, placed in the Dock, or even set as login items in order to connect to the servers.

click to expand
Figure 10-11: Mac OS X Finder can store the locations of servers in individual documents that can be launched with a double-click.

While making an alias for a server is possible, because of the way Mac OS X’s Unix underpinnings deal with alias links across networks, making a favorite is the proper way to save a server’s location.

Recognizing your access privileges

Just as you can recognize your access privileges to folders on your Mac in the Finder, the same indicators are present for server volumes and the folders they contain. The symbols for each type of privilege and description of access are as follows:

  • Read Only: A small icon that looks like a pencil with a line through it appears in the status bar for a folder or volume where you can see the contents but may not change them.

  • No Access: A folder icon with a circled red do-not-enter sign in the lower-right corner is a volume or folder that you cannot open or otherwise manipulate.

  • Write-only access: A circled blue down arrow in the lower-right corner marks a drop box folder. You can put files into a drop box, but you cannot open it.

Figure 10-12 shows examples of these folder icons and the Read-only indicator in the bottom left-hand corner of the Finder window, the pencil with the line through it.

click to expand
Figure 10-12: Special folder icons and an icon in the status bar indicate your access privileges.

Transferring network files

When you’ve got a server volume mounted in the Finder, OS X treats it like any other disk; that is, you can copy files to and from it (if you have the correct access privileges), you can open files from it in Open/Save dialog boxes from any application, or, you can open files directly from the server without copying them to your drive first.

Depending on your network, and the types and sizes of the files that you are working on, opening and editing files directly from the server can be a great way to streamline work, or it can be a huge, slow, crash-prone nightmare. In general, the faster your network is, the more reliable your connection is, and the smaller your files are, the better shape you will be in. For example, on a network of even very modest speeds, opening and saving Microsoft Word documents off of the server can be fine, and this eliminates the need for always first copying the file to your hard drive, and then copying it back when you are finished with your work. If you are working on a file locally (after copying it to your machine), it’s possible for another coworker to also work on the same file without you knowing. You’d then run the risk of copying over her saved changes when you copy the file back. If, however, you are editing gigabyte-sized Photoshop files, working over the network would be a slow and frustrating process, and prone to data loss. In more advanced setups with OS X Server, it is possible to have your entire home folder located on the server, and not locally on your machine. In this case, all your work is being done off of the server, even when applications request preferences and fonts.

Opening network files

Because Mac OS X treats mounted server volumes exactly as though they are local disks, you can navigate to them in an Open dialog, as shown in Figure 10-13, and open them. Similarly, you can save to the network server in a Save dialog.

click to expand
Figure 10-13: Open a file from a server just as though it is a local disk.

Disconnecting from network volumes and servers

When you finish using a network volume, you can remove it from the Finder by using any of the following methods:

  • If the server is mounted on the desktop, you can drag the volume’s icon to the Disconnect icon in the Dock. (The Trash icon changes to a Disconnect icon when you’re dragging a network volume.) You can also Control-click the volume’s icon and choose Eject from the contextual menu.

  • Select the volume’s icon and choose File Eject (Name of Disk) or press z-E on the keyboard.

  • Click on the eject icon that is visible from the sidebar in Finder windows.

Removing a network volume from the Finder is also known as unmounting (not dismounting) the volume.

Disconnecting from a network file server involves no more than removing all that server’s volumes from the Finder. It can be common to get errors upon attempting to unmount a network volume; these errors generally say something to the effect that the volume is still in use. A volume is in use as long as a file or application is open directly from it. If this is the case, quit any of your open programs and try again. If it still won’t unmount, it’s quite possible something is being used off of the disk, but it’s nothing you can see or close. Often, relaunching the Finder (hit z-Option-Escape or go to Apple menu Force Quit) will fix this problem.




Mac OS X Bible, Panther Edition
Mac OS X Bible, Panther Edition
ISBN: 0764543997
EAN: 2147483647
Year: 2003
Pages: 290

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net