Macintosh: Telnet & FTP

Terms You Need to Know

The following table is for your reference as you learn about telnet and FTP:

Term Definition
Client A program you use to request a resource or service from another program called a "server." For example, you may use a client to request a file from a file server. Generally, the client is located on a different computer from the server, often on your own desktop. See "Server." Download Simply put, to "get" a file from a server. To be more specific, it means to transfer files between two computers, usually, to transfer files from a server on a larger computer to a client on a smaller computer. See "Upload." Host A computer, connected to a network, that allows you to log in and use resources. For example, fog is a host computer you may use for your email service. IP Number Internet Protocol number. The unique number that identifies a computer on the Internet. You can use a computer's name or its IP number when you specify its address. Server A program that "serves up" resources and services you request using your client program. The server is usually located on a "host" computer. "Host" and "Server" are frequently used interchangeably. See "Client." Upload Simply put, to "put" a file onto a server. To be more specific, it means to transfer files between two computers, usually, to transfer files from a client on a smaller computer to a server on a larger computer. See "Download."

We got help with these definitions from the Free On-line Dictionary of Computing at http://wombat.doc.ic.ac.uk/.

Just what are Telnet and FTP?

Telnet and FTP are protocols, a set of formal rules for transmitting data. You use these protocols to connect to servers on the Internet for two different purposes:

Telnet

You may already be using telnet to log on to the campus email server, or to log on to hosts that provide public access, such as the library's public information server. To telnet to a host from a Macintosh with a direct Internet connection, you can use a program called NCSA Telnet. You cannot use NCSA Telnet if you're using a modem, but you can telnet using UNIX commands as discussed later in this document.

Making a Telnet Connection With NCSA Telnet

To see how NCSA Telnet works, try telnetting to the library server. Double-click on the NCSA Telnet icon to start the program. In the Host/Session Name field, type the name or IP number of the host you want to access. Then click on the Connect button. If your connection is successful, your host session begins.

To gain access to the host, you now provide a user ID or name, and, on many hosts, a password. If a host offers public access, this screen usually displays the required user ID and password.

You can download NCSA Telnet from ftp://ftp.ccsf.org/pub/TCP/.

Moving Around and Exiting

The way you move from screen to screen in a telnet session varies from host to host. You often find this navigation information displayed at the bottom of the screen. Many hosts provide a menu structure that's easy to use, but some do require you to use UNIX commands. If you're having difficulty in a session and can't find help on the screen, try typing help. If you want to exit the session but can't find the command, try typing exit. After you exit from one host session, you may want to telnet to another host using NCSA Telnet. Select Open Session from the File menu, and complete the pop up window again. When you've completed all your sessions, you can quit NCSA Telnet by selecting Quit from the File menu.

Making a Telnet Connection With the UNIX Command

Once you connect to a host, you can telnet to a different host using the UNIX command "telnet". If you have a direct Internet connection, it's preferable to use NCSA Telnet instead to conserve Internet resources. If you're using a modem, however, you'll want to use UNIX to telnet to "foreign" hosts. First connect to your campus server with a communications program such as MacKermit or ZModem. Then at the UNIX prompt, type
   telnet hostname

Telnet's Limitation

You can get access to a great deal of information and services through telnet, but you cannot transfer files. To transfer files, use the File Transfer Protocol (FTP), which is discussed next.

FTP

You can use FTP to transfer files between: Anonymous FTP servers allow you to log on and transfer files, even though you don't have an account on the servers. Let's look at some reasons you might use FTP.

If you have an account on a server on campus, you can use FTP to upload files from your PC to your account. With the file in your account, you might then want to email it, for example. Downloading files through anonymous FTP is a good way to get free software and other types of files. (Note: before you run any software you download, be sure to check it for viruses. When you download text files, however, you don't need to worry about infecting your computer with a virus; viruses are transmitted only through program files. Some servers also allow the public to upload files to selected directories--which is why you need to be careful about viruses when you download programs.)

Two Kinds of FTP

For FTP on the Macintosh, you can use a package called Fetch, or use UNIX commands. Fetch is a microcomputer software package that you'll put on your Mac hard drive. Although it can only be used with a direct ("hard-wired) connection (i.e. not with a modem connection), Fetch has distinct advantages over UNIX ftp. Unix ftp is a mainframe client. This means that you can connect via modem to a host like fog and ftp files to your account there. Both kinds of ftp are discussed below.

Using Fetch

First Things First: Connect to a Host

If you have a direct ("hard-wired") Internet connection, you can use Fetch to transfer files between a server and another computer connected to the Internet. To start Fetch, double-click on the Fetch icon. This dialog box pops up:

*Graphics here*

Use the dialog box to log on to the host you choose. Type the name or IP number of the host in the Host field. Next, complete the User ID and Password fields in one of two ways:

To go immediately to the directory you want, you can complete the Directory field, but you must type each letter in the correct case (lower = abc, upper = ABC). It may be easier to move through the directories after you make your connection. When you're ready, click on OK.

Downloading and Uploading Files

When Fetch connects to the host, you'll see a window like this one:

*Graphics here*

You can move around in the server's files by changing the current directory (click on the box displayed above the list of files), and by double-clicking on the different folders to display their contents. Notice that you can either "Get" (download) a file from a server, or "Put" (upload) a file on a server.

Steps for Downloading

To download, do the following:
  1. Select the file, group of files, or directory you want.
  2. Specify the file type by selecting Automatic, Text, or Binary.
    • For plain text files, select either Automatic or Text.
    • For program files, select Binary. If you're unsure of the file type, try Binary.
  3. Click on Get. A window pops up that allows you to save the file.

    *Graphics here*

  4. Select the file's destination, and click on Save.

Making Files Usable

Often the files you download will be compressed so that they take up less disc space. You have to expand these files before you can use them. A program called Stuffit expands and installs most compressed files for the Macintosh.

Steps for Uploading

The process for uploading files with Fetch is similar to downloading:
  1. Connect to a host. Usually you'll connect to a server on which you have an account, such as your email server. If that's the case, be sure to log on using your own user ID and password, rather than logging on as anonymous.
  2. Locate the directory on the server where you want to put your file.
  3. Click on Put. A window pops up showing files available to you locally:
  4. *Graphics here*

  5. Select the file, files, or directory you want to put onto the server (upload). Then click on Open. This window pops up:

    *Graphics here*

  6. Now you can save a copy of the file to the directory you chose on the host. You may want to change the file name or format. Consider your options carefully before you change the file format. In the example shown, we're uploading a regular Microsoft Word document. Fetch automatically specifies the format as MacBinary II, which preserves any formatting in the document. You may have a reason to change the format to Text; for example, if you want to read the file into the body of an email message, rather than attach it as a separate file. All formatting is lost, but the document is readable. For more information about the other file formats, look at Fetch's on-line help (Fetch Help under the Windows menu).
  7. When you click on OK, Fetch completes the uploading process.

Fetch Menu Commands

The following table below lists some ways you can customize your Fetch session.
If you want to . . .             then choose        and select . . .           
                                 this menu . . . 
See file sizes, the date files Remote View File List were last saved, and other detailed file information
Preview the contents of a Remote View File file; select the file and . . .
Select files from different Remote Put Folders and Files . . . folders to download
Specify a Host connection that Customize Edit Shortcuts comes up automatically when you start Fetch (default connection)
For more options, refer to Fetch Help.

Closing Your Connection

Click on Close Connection in the Fetch main window to close your connection to a host. If you're visiting an anonymous FTP server, it's especially important that you close your connection as soon as you've transferred the files you need. FTP servers limit the number of connections that can be made at any one time, so you open up a space for someone else when you close your connection. When you've completed all your sessions, you can quit Fetch by selecting Quit from the File menu.

Using UNIX Ftp

You may want to use UNIX commands to transfer files if, for instance, you're using a modem. The following table lists some commands you'll use:

Command Description
ftp ftpservername Opens an FTP session at the server you specify. binary Sets the file transfer type to binary. Critical to the successful transfer of files such as Word documents, graphics, or software packages; also works fine with text files (files that contain only ascii text and no formatting). get filename Transfers the file you specify to your account on the campus server. mget file1 file2 Transfers multiple files you specify to your account on the campus server. ls Lists all the files in your current subdirectory (folder in Mac lingo). cd subdirectory Changes the directory. To move back up to a previous level, use "cd .." (note the space). This is the equivalent of double-clicking on a folder. put filename Transfers a file from your account on a server to a directory on another server. mput file1 file2 Transfers multiple files from your account on a server to a directory on another server. pwd Tells you the present working directory, or in Mac lingo, the current folder. <control>+h Deletes a character to the left of the cursor (acts as a backspace). Note: use the control key; don't type the word "control". help command Displays the definition of a command. Type "help" to see a full list of valid commands. bye Ends the FTP session.

Steps for Downloading

Here are the steps for downloading a file using UNIX commands:
  1. Connect to your campus server.
  2. At the UNIX prompt, type ftp ftpservername. To use the example from our discussion of Fetch, we type ftp ftp.ccsf.org. Note: often "ftp" will be the first level of the server name as well as the command you use to establish an ftp connect; be sure that you do not omit it in either case.
  3. Log on to the FTP server.
    • If you don't have an account on the server, log on as anonymous. Use your email address as the password.
    • If you have an account on the server, log on with your ID and password.
    If the server is available, the ftp prompt appears.
  4. Find the file you want. Refer to the previous table for commands you'll need. To continue our example:
    • To see the name of the current folder, type pwd.
    • To change to the Netscape directory, type cd pub/Netscape.
    • To see the files listed in that directory, type ls.
  5. Type binary to set the file transfer type.
  6. Type get filename. The file is transferred to your account on the campus server. To get the file in our example, we type get netscape3.02Gold.hqx.
  7. To move the file from the campus server to your computer, use Fetch or, if you're on a modem, use Kermit.

Uploading

Uploading files is a similar procedure. To upload a file, telnet to the campus server from which you want to transfer a file to another server. Note the name of the file you want to transfer. FTP to the target server and log on. Find the directory to which you want to transfer the file. At the FTP prompt, type put filename. The file is transferred.

FTP on the World Wide Web

You can also transfer files on the World Wide Web using FTP. Details of the FTP session vary with the browser you use, but generally, you simply point and click to select a file to download. Of course, the file must be available at an FTP server for you to be able to download it. The browser steps you through choices for downloading, depending on your computer setup.
___________________________________CCSF___________________________________

[Web Weaver] [CCSFweb] [CCSF Info] [Events] [Site Index] [Help]