CHAPTER 6 - Telnet & FTP - Connecting to Other Computers & Getting a File from There to Here

 

6.1 Introduction to Telnet

 

In other chapters of this book, you have connected to other computers by traversing menus using gopher or by using one of the www browsers.  Often you might want to connect directly to another computer for services that are not provided on your computer.  For example, one of the authors does not have a mail server on his PC.  He needs to connect to another computer to read and send mail.  One of the ways of connecting to another computer on the Internet is using the Telnet protocol.  Telnet was one of the first protocols developed for the Internet.  It was designed to allow users around the world to use computers located at remote sites.  The program telnet is designed to make use of this Telnet protocol.

 

Today telnet is used to by individuals to log into other computers that they have accounts on.  Telnet is also used to log into computers that provide access to services such as library catalogs, Internet resources like gopher or archie, or other facilities that can be made available to others.  With the increased use of the World-wide Web, less emphasis is being placed on using telnet to connect to other computers.

 

6.2 How to Use Telnet

 

6.2.1 Internet Addresses

 

Before you can connect to another computer, you must know its Internet address.  All Internet hosts have two kinds of addresses.  Most of the time you will be able to use the domain address that is written in text, e.g. www.jaring.my.  Domain addresses usually have at least three parts.  The last part is either a two-letter geographic top-level domain or an organizational top-level domain (See Fig. 6.1). The next to last part of the address is a sub-domain that generally represents the institution.  The leftmost sub-domain of the address usually represents a computer at the institution.  So the address www.jaring.my represents the computer running the www server at the jaring institution in Malaysia.        

 

Underlying the domain address is another address called the IP (Internet Protocol) address. This address is a numeric address represented as four numbers separated by periods. When you attempt to access a computer using its domain address, the address is converted into the corresponding IP address and then the connection is made.  For example, if you were to telnet to www.jaring.my, the domain address would be converted to the IP address 192.228.128.16.  You can use the IP address anywhere that you would use the domain address.  There may be a few occasions where a domain address will not be recognized and you will have to use the IP address.

 

6.2.2 The Telnet Program

 

To use Telnet, you need to run a program often called telnet on your computer.  This program uses the Internet to connect to the computer you have specified.  You can either run the telnet program by typing telnet with no arguments, or by typing telnet followed by the name of the host you are connected to on the command line- telnet www.jaring.my.   If necessary, you may have to follow the domain address with a port number.

 

Domain             Meaning

com                              commercial

edu                               educational

gov                               government

int                                 international organizations

mil                                military

net                                networking organization

org                                non-profit organization

au                                 Australia

ch                                 Switzerland ("Confoederatio Helvetia")

de                                 Germany ("Deutschland")

es                                 Spain ("Espana")

jp                                  Japan

my                                Malaysia

sg                                 Singapore

tw                                 Taiwan

uk                                 United Kingdom

us                                 United States

Fig. 6.1Examples of Top-Level Domains

 

If you only type telnet on the command line, your computer's prompt will change to telnet> and you will need to use the open statement to connect to another computer on the Internet, e.g.  

telnet> open www.jaring.my

 

The first few messages you see will be messages from your computer.  These will be followed by messages from the remote computer.  Usually you will be asked to enter your a user-id and password.  (See Fig. 7.2) Some of the public telnet sites will allow you to access them without a user-id and password.  Once this happens, you are logged onto the remote computer and can use all of the instructions that are appropriate for the remote computer.

 


When you are finished using the remote computer, you should log-out.  This often does not close the connection between your computer and the remote computer.  If you are still connected to the remote computer, you can break the connection by pressing CTRL-].  This will return you to the telnet> prompt.  You can then connect to another computer using the open statement or quit and return to using your own computer.  If you run into trouble, the question mark (?) will bring up a list of available commands.

 

-VE> telnet ppp.itm.my

Trying...192.228.170.5

Connected to PPP.ITM.MY.

Escape character is '^]'.

 

SunOS UNIX (pppitm)

 

login: wayne

Password: **************

Last login: Fri Jun 16 05:51:38 from venus.nmhu.edu

SunOS Release 4.1.3 (GENERIC-MAR17) #1: Fri Mar 17 09:03:22 SST 1995

Fig. 6.2 - Logging into another computer using telnet

 

Occasionally, you will not be able to connect to a remote site.  If you incorrectly type the domain address, you will see an error message as shown in Fig. 6.3. Sometimes the remote computer may not be running or all the lines may be busy.  If this happens, you will typically see a message like the one shown in Fig. 6.4.

 

-VE> telnet newton.dip.anl.gov

%UCX-E-TELNET_GETHST, Error in getting host name

Fig. 6.3 - Incorrect address

 

-VE> telnet irc.nsysu.edu.tw

Trying...140.117.11.33

%UCX-E-TELNET_CONECT, Failed to connect to remote host

Fig. 6.4 - Cannot connect to remote computer

 

When you connect to a remote computer, you will often be asked to enter a terminal type.  In the early days of computing, most users worked at terminals connected to the mainframe or minicomputer.  Today to connect to many servers, you need to emulate one of these types of terminals.  This is done using a terminal emulation software package.  The most common ones are DEC's (Digital Equipment Corporation) VT100 and VT220.  If the remote computer asks for a terminal type, try one of these first.  If neither works, try TTY which is the standard for teletypes.

In a few cases, telnet will not work.  If a computer is an IBM mainframe, it will expect you to use the program tn3270.  You can usually identify these by the VM or MVS in the introductory messages from the remote computer.  When you see this, try typing tn3270 instead of telnet.


 

6.3 Telnet Software

Two of the more popular public domain / shareware packages for the PCs are TELNET and WinQVT (Fig. 6.5).  These both are available through common ftp sites discussed later in this chapter.  They are both easy to install under Windows. 

 

Fig. 6.5 - telnet icons

 

To use TELNET, click on its icon.  A standard introductory window will appear (Fig. 6.6).  Choose remote connection from the Connection menu.  This displays a Connect window (Fig. 6.7).  This window has three list boxes.  Use the first one to specify the host computer's domain name.  The second and third list boxes can be used to change the port number and terminal type if necessary.  After pressing the Connect button, you will be connected to a remote host (Fig. 6.8).

 

Fig. 6.6 - TELNET introductory window

 


Fig. 6.7 - TELNET Connect window

 

Fig. 6.8 - Using TELNET to connect to a remote host

 

WinQVT is just as easy to use and contains facilities for connecting to ftp and UseNews.  After pressing the WinQVT icon, an introductory window will be displayed (Fig. 6.9).  Either press the terminal icon or select telnet from the File menu.  A connection window will be displayed (Fig. 6.10).  After inserting the host domain name or IP address, and pressing OK, you will be connected to the remote host (Fig. 6.11).


 

Fig. 6.9 - WinQVT Introductory window

 

Fig. 6.10 - WinQVT connect window

 

6.4 Introduction to FTP

 

FTP (File Transfer Protocol) is a set of rules for transferring files between computers, usually connected through the Internet.  If your computer supports FTP and is connected to the Internet, then you can access a large number of computer systems containing a large number of files.  This facility was one of the main reasons for the initial popularity of the Internet. The program that supports the transfer of files using FTP is ftp.  You can access information on virtually any topic using ftp. In addition, you can access a multitude of archives of software for most computer systems (DOS, UNIX, Macintosh, etc.).

 

FTP uses the client / server model that was discussed with gopher. Both client and server computers need to be running the ftp software.  Unfortunately most of the non-Windows versions of ftp are not particularly easy to use.  Ftp sites can also be connected to using Netscape and Internet Explorer, but only for downloading of files.

 

Fig. 6.11 - Connecting to remote host using WinQVT

 

6.5 How to Use FTP & Anonymous FTP

 

To use ftp, you need to know the address of the FTP site you want to access.  To connect to an FTP server, type ftp <server address> where server address is either the domain name or IP address of the FTP server (Fig. 6.12).  If you only type ftp, your computer will display the FTP prompt, and you will be expected to use the open command followed by the server address. Many of the servers will then display a lot of information about the site while others will only identify the site. 

 

There are two ways to connect to the FTP server.  If you have account on the server, you can log on normally and access any of the files in your account.  In most cases however, you will be using anonymous ftp.  To use anonymous ftp, you will type in "anonymous" as the login name and type in your e-mail address as the password for the server computer. Most FTP servers will accept anything for the password, but it is polite to type your e-mail address.

 

Many of the FTP sites are very busy and you might see the following message

 

530 Too many users connected currently, please try again later.

 

Try again later.  As you use ftp, you will notice that all of the responses from the FTP server are preceded by an identification number.  You can ignore these numbers. Once you have logged onto an FTP server, you will need to navigate around the file system.  One of the first commands you should enter is help  or ? (Fig. 6.13).  This will give you a list of available commands on the FTP server.   Table 6.1 describes many of the commonly used commands.

 

-VE> ftp ftp.jaring.my

 

220 pop.jaring.my FTP server (Version 2.1aWU(6) Wed Dec 7 18:22:15 MYT

Connected to pop.jaring.my.

Name (FTP.JARING.MY:wsummers): anonymous

331 Guest login ok, send your complete e-mail address as password.

Password:

230-          Welcome to FTP server on Jaring Network, Malaysia

230-

230-                Local time is Sat Jun 17 00:00:36 1995.

230-

230-Dear Guest from venus.nmhu.edu,

230-

230-This FTP server is still experimental.

230-

230-The main purpose of this machine is to serve as a local distribution

230-point for publicly available software and data, gathered from other

230-servers worldwide.  To conserve bandwidth, users from outside Malaysia

230-should not use this machine to pick up data which originated from other

230-foreign sources.  Please get them from other servers nearer to you.

230-

230-All transactions are logged.  If you don't like it, please log off.

230-

230-Uploading is allowed into /pub/incoming directory on FTP.JARING.MY only.

230-We will move it to /pub/share if you let us know by e-mail (noc@jaring.my).

230-Give us a short description of the package.

230-*** IF WE DON'T RECEIVE ANY NOTIFICATION, THE FILE WILL BE DELETED ***.

230-

230-===================================================

230-  Please use ftp.jaring.my rather than jaring.my.

230-===================================================

230-

230-Thank you for your cooperation.

230-

230 Guest login ok, access restrictions apply.

FTP>

Fig. 6.12 - Using ftp to connect to ftp.jaring.my

 

Fig. 6.13 - List of ftp commands

 

Command Description

?   / help                                 Displays ftp commands

ascii                                        Specifies that files are to be transferred as ASCII files

binary                                     Specifies that files are to be transferred as binary files

bye  /  quit                             Closes the current connection and returns you to your computer

cd remote directory             Changes the directory on the remote computer

cdup                                       Same as cd ..

close                                       Closes the current connection and returns you to the FTP prompt

dir                                           Lists the long contents of the directory, similar to UNIX command ls -l

get remote file                      Copies the named file from the remote host and stores it on the local host with the same file name

hash                                       Causes a # to appear for each block of transferred data

lcd local directory               Changes the directory on your local computer

put local file                         Copies the named file from the local host and stores it on the remote host

pwd                                        Tells you the name of the current directory on the remote host

Table 6.1 - Description of ftp selected commands

 

One of your first tasks is to determine where you are and where you can go in the remote computer's directory structure.  You might start with dir, which gives you a list of the subdirectories (Fig. 6.14). This usually gives you more information than you need.  The names of the subdirectories and files are the last column.  Different computer systems have different ways of organizing their files, but most archives are similar to the examples shown. If all you are interested in are the directory and file names, you can type ls (Fig. 6.15). The command you might next want to use is cd, to change to a subdirectory containing the file(s) that you are interested in (Fig. 6.15).  If you lose track of where you are in the file structure of the remote computer, you can type pwd  to display the name of the current directory.


 

FTP> dir

200 PORT command successful.

150 Opening ASCII mode data connection for /bin/ls.

total 22

drwxr-xr-x   6 noc      noc          512 May 23 16:50 .

drwxr-xr-x   6 noc      noc          512 May 23 16:50 ..

lrwxrwxrwx   1 root     other          7 Nov 26  1994 bin -> usr/bin

d--x--x--x   2 root     other        512 Nov 26  1994 dev

d--x--x--x   3 root     other        512 Dec  1  1994 etc

drwxrwxr-x  31 noc      noc         1024 Jun 16 09:05 pub

d--x--x--x   4 root     other        512 Nov 26  1994 usr

 

226 Transfer complete.

492 bytes received in 00:00:00.89 seconds

FTP>

Fig. 6.14 - Using the dir command

 

FTP> cd pub

250-Please read the file README

250-  it was last modified on Sat Dec  3 22:31:03 1994 - 196 days ago

250 CWD command successful.

FTP> ls

200 PORT command successful.

150 Opening ASCII mode data connection for file list.

msdos

README

pcdos

.cshrc

info

.kermrc

list.txt

pub

usenet

jalinan

incoming

simtel

archives

list.Z

jaring

cica

budget95

internet

tmp

226 Transfer complete.

289 bytes received in 00:00:00.22 seconds

FTP>

Fig. 6.15 - Using the cd and ls commands


 

Once you have located the file(s) that you want to download, you can use the get command.  If the file is a text file, you would use the default setting of ascii to retrieve it.  However, if you are downloading programs or utilities, you will need to specify the binary setting before using the get command.  Since many of the files you download can be quite long and take a long time to download, you might want to issue the hash command before the get command.  This will allow you to monitor the progress of the file retrieval (Fig. 6.16).

 

FTP> binary

226 Transfer complete.

FTP> hash

Hash mark printing on (1024/hash mark).

FTP> get list.Z

200 PORT command successful.

150 Opening BINARY mode data connection for list.Z (434072 bytes).

##############################################################################

###############################################################

226 Transfer complete.

local: LIST.Z  remote: list.Z

434072 bytes received in 00:02:18.18 seconds

FTP>

Fig. 6.16 – “getting” a file

 

Usually, files are grouped together in a compressed file to minimize the amount of data transfer.  The most common archival and compression file formats are "tar" and "zip".  Tar archives a collection of files appended together and can be unpacked by running the UNIX command tar. Zip files can be unpacked and decompressed using unzip or PKUnzip.  Table 6.2 lists many of the common file types you will find along with whether to download them using binary or ascii.  To get a more complete list of file compression and archiving methods for a wide variety of computers, ftp to the following site and retrieve the file there.

ftp.cso.uiuc.edu directory: /doc/pcnet/compression

 

6.6 How to Find Files?

 

Finding a file on the Internet using ftp  can be quite overwhelming.  Certainly you can browse each site and traverse all of the subdirectories, but not if you have other things to do.  Fortunately, there is a solution called archie.  Archie, short for archives, is a database system that keeps a list of files on different FTP sites.

You can use archie in several ways.  If your computer has the archie client installed, you can simply run it from there by typing archie.  You can also use e-mail to an archie server requesting the locations of files. The third method is to telnet to an archie server and use it there (Fig. 6.17).  Table 6.3 lists several sites maintaining archie servers. You can send mail to many of these sites at 'archie@site_name' for a help file. Log onto these any of these servers using "archie" as the login name and press the "Enter" key for the password.

 

SUFFIX                  FTP        TYPE

.arc         bin          ARChive (hardly used anymore)

.arj           bin          Arj (mostly MS-DOS)

.au                           bin          Audio sound files

.gif         bin          Graphics Interchange Format

.gz          bin          GNU Zip

.hqx                         asc          HQX (Mac, Mac equivalent of uuencode)

.jpg                         bin          JPEG (graphics format)

.lzh         bin          LHa, LHarc, Larc

.mpg                       bin          MPEG (graphics format)

.shar                       asc          SHell ARchive (mostly Unix)

.sit           bin          Stuff-It (Mac)

.tar         bin          Tape ARchive (mostly Unix)

.txt                           asc          Text File

.uu                          asc          uuencode/uudecode (also .uue)

.wav                        bin          Wave sound files

.Z           bin          compress (mostly Unix, seen in combination with tar as .tar.Z files)

.zip         bin          Zip (either PKZip or Zip/Unzip)

.zoo                         bin          Zoo

Table 6.2 - Common file types found on FTP servers

 

To find a file called 'filename' you would type: archie filename if you are using a client or prog filename (Fig. 6.18) if you are logged onto an archie server. There are lots of options available, so you will probably want to use help. Once you have entered the command, sit back and wait.  Archie servers are generally very busy and it may take quite a while to locate all of the files you are interested in.  Most servers will give you an estimate of how long it will take and how far down the queue you are on that server. Be patient and be willing to try another server.

Fig. 6.17 - Atelneting@ to an archie server

 

 

domain name                                        IP address                             country

    archie.au                                            139.130.4.6                             Australia

    archie.th-darmstadt.de                    130.83.22.60                           Germany

    archie.wide.ad.jp              133.4.3.6                                 Japan

    archie.kr                                             128.134.1.1                             Korea

    archie.sogang.ac.kr          163.239.1.11                           Korea

    archie.luth.se                                    130.240.18.4                           Sweden

    archie.switch.ch                               130.59.1.40                             Switzerland

    archie.ncu.edu.tw             140.115.19.24                         Taiwan

    archie.doc.ic.ac.uk                           146.169.2.10                           United Kingdom

    archie.unl.edu                                   129.93.1.14                             USA

    archie.internic.net                            198.48.45.10                           USA

    archie.rutgers.edu                            128.6.18.15                             USA

    archie.ans.net                                   147.225.1.10                           USA

    archie.sura.net                                  128.167.254.179     USA

Table 6.3 - List of archie  servers

 

 

 

Fig. 6.18 - Finding files about Kuala Lumpur

 

6.7 FTP and Archie Software

 

There are several very good software packages for Windows and Macintosh users.  These are available from most of the popular ftp archive sites listed in the next section.

 

Windows users might look for WS_FTP32, FTP, WinQVT and WSArchie.  All of these are available in sites listed in the next section.  Once you have downloaded the ZIP file and "unzipped" it, you will need to create a program icon and install the program as a Windows application.  To activate the program, simply click on the icon (Fig. 6.19).

Fig. 6.19 - FTP icons

 

Once you've clicked on the FTP icon (Fig. 6.20), you will see the ftp prompt.  You will need to open the site of the FTP server and then you can issue any of the ftp commands.  Don't forget to type bye when you are finished so that your computer will be disconnected from the remote server.

 

Fig. 6.20 - FTP client

 


WS_FTP has a much nicer user interface.  After you click its icon (Fig. 6.21), a "Session Profile" window will open.  In the Session Profile window, you will be able to specify the host name, its type, the user id and password.  All of this information can be saved for use later.  After connecting to a remote host (Fig. 6.22), you can move up and down the file structure by clicking on the subdirectories.  To copy a file from one computer to the other, you simply highlight the file to be copied and specify the directory where you want it placed and then press the appropriate arrow.

 

After clicking the WS_Archie icon, You will need to enter the word or filename to search for, select the name of an archie server, and select the type of search to perform (Fig. 6.23).  Archie "searches" can take quite some time, so be patient and hopefully you will find what you're looking for (Fig. 6.24).

Fig. 6.21 - WS_FTP Session Profile Screen

 

Fig. 6.22 - Copying files between connected computers

 

 

Fig. 6.23 - WS_Archie

 

Fig. 6.24 - Results of an archie search


6.8 Where to Go From Here

 

The best way to learn how to use these Internet tools, is to experiment with them.  The following are lists of interesting telnet and ftp sites for you to explore.  As you explore one, you will find many more to explore from there.

 

Telnet Sites

hermes.merit.edu                                                  directory of remote services (type HELP at prompt)

martini.eecs.umich.edu 3000 (martini)               Geographic Name Server

books.com                                                             BBS bookstore

career.com                                                             BBS career service

freenet-in-a.cwru.edu                                          Cleveland Free-Net BBS

tudrwa.tudelft.nl                                                   Delft University BBS (log-in as bbs)

heartland.bradley.edu                                         Heartland Freenet BBS (log-in as bbsguest)

Table 6.4 - Telnet Locations

 

FTP Sites

ftp.jaring.my                                                          Malaysian ftp site

ftp.cica.indiana.edu                                             Windows archive

sumex-aim.stanford.edu                                      Macintosh archive

wuarchive.wustl.edu &

oak.oakland.edu                                                   DOS & Amiga archives

ftp.rpi.edu                                                              Internet & Computer-Mediated Communications

                                                                                                (AKA The December List)

csd4.csd.uwm.edu                                               Special Internet Connections (Scott Yanoff s List)

ftp.cs.wisc.edu                                                     Landweber's list of connected countries

rtfm.mit.edu                                                           archive of USENET newsgroups

ftp.netcom.com/pub/mailcom/internaut           on-line magazine

boombox.micro.umn.edu                                     University of Minnesota's ftp site

sunsite.unc.edu                                                    University of North Carolina's ftp site

ftp.iij.ad.jp                                                             Tokyo

tricera.nmhu.edu                                                  New Mexico Highlands University

ftp.borland.com                                                    Borland

ftp.microsoft.com                                                                 Microsoft

ftp.novell.com                                                       Novell

ftp.netcom.com                                                     SlipKnot

ftp.NCSA.uiuc.edu                                              Mosaic Web

ukanix.cc.ukans.edu                                            Lynx

ftp.utas.edu.au                                                     Trumpet News Reader

ftp.mcom.com                                                       Netscape

titan.ksc.nasa.gov                                                                NASA

rtfm.mit.edu                                                           Compression FAQ & ftp lists

cs.ucr.edu                                                              Computer Viruses archive

Table 6.5 - ftp sites