TELNET by jianghongl



Telnet is a protocol that allows you to connect to a remote computer (for example, your web
server) and type commands that will be carried out on the server, such as moving and copying
files, creating directories (folders), and running scripts. Most computers such as Windows PC's
have a Telnet program built-in.

Note that not all web hosts will give you Telnet access to your web server. This is often for
security reasons, or because the host is running a non-UNIX web server such as Windows.


Telnet can be used to access your own remote Telnet account, UNIX workstation
or a public information resource set up for Telnet, such as the US Library of
Congress. If you access your own computer or account remotely by Telnet, you
will use the UNIX commands of the UNIX shell run at the destination. However,
information sources that are available using Telnet do not require knowledge of
UNIX. All you need, besides a network connection, is a Telnet client like the
Windows' Run dialog box or a UNIX command line.

The Telnet command is similar to using the ftp command. More than just license
to transfer and move files around like ftp, though, Telnet gives you access to the
destination system's functions and files. The user name you use to access the
space determines the limits on what you can do -- restricted to just using the
menu to find information or permitted the liberty to execute programs. Unlike ftp,
Telnet has no graphical user interface (GUI). It's all ascii and command line - set
your mouse aside.

Telnet was one of the Internet's first tools, created to work across a broad range
of platforms, terminals and displays. Now that Windows has Telnet built-in (via
the Run dialog box or more lately, using the address box on the browser), it's
easy to log into a telnet account or site on the Internet once you have an Internet
connection running on both computers. If the source or the destination computer
sit behind a firewall, either the firewalls have to allow your telnet sessions or you
need to be able to log into the firewall and Telnet from or to the public side of it.
Get information about security policy from the network administrator.

If your own computer is the destination of the Telnet session, it must be
configured to let you run programs -- read your email, for example. And you need
to learn the menu commands of these programs. However, programs can be run
on the remote UNIX system to let you access email stored there using an email
program like Pine, Elm or Mail. Common editors are Pico, VI and EMACS. If a
program only has a GUI interface, Telnet probably won't reach the data.

UNIX gives you extensive help in its manual pages. On a UNIX command line,
type man Telnet to learn more about Telnet and its commands. Hadn't heard of
man? Type man man
When accessing public Telnet sites, be sure to read and follow instructions
because every Telnet site can be quite different in the way it provides information
to you, whether it requires using the menu system or remembering complex

To open a Telnet session, go to the UNIX command line or the Windows Run
dialog box, and type

telnet [hostname]  enter your user name and password, or the access
information you know the computer requires

Command line interface is a different world of computing, but Telnet's
accessibility throughout the world -- most Internet cafés are running Windows -
makes it worth learning a few command lines. On the other hand, accessing
public information via Telnet is more specialized these days with so much
information now offered via the World Wide Web. Here are a few public sites to
try. If you use a recent browser, it will launch Telnet for you.

US Library of Congress

A system of US libraries
Login: PAC (Choose VT100)

       What is Telnet?
       Telnet clients we recommend for use.
       Connecting to HelpQuest.Com through Telnet.
       Connecting to the HelpQuest.Com server.
       Basic Telnet commands for beginners.
       Using PICO (editor client) in Telnet.
       Talking to other users on Telnet.
       Testing your CGI scripts through Telnet.

What is Telnet?

Telnet is a protocol most often used to connect to a UNIX system because of its command line
interface. Telnet is a very useful protocol when properly used but lacks graphical user interface.

Telnet has a number of advantages over FTP including the ability to chat with users, pinpoint
problems in CGI scripts, delete directories that are not empty, and edit files without downloading
them from the server.
Telnet clients we recommend for use.

We recommend a program called CRT Telnet by VanDyke Technologies. You can download CRT
Telnet from our FTP site or from VanDyke Technologies. Below are FTP download sites:

Windows comes with a telnet program. Click the Start button on the Windows taskbar, then click
Run. Type in "command" (without quotes). In the small window that opens, type "telnet" (without
quotes) at the command prompt.

Connecting to the HelpQuest.Com server.

Connecting to HelpQuest.Com via telnet is simple. Use your domain name or your IP address as
the hostname. In the telnet window of CRT or Windows telnet, you will then be prompted for your
login and password. Once you enter this information and the server verifies this information, you
will be logged into the root (/home/your_login) of your account.

Basic Telnet commands for beginners.

Telnet comes with a large number of commands that cannot all be discussed in this brief tutorial.
Below we attempt to address basic telnet commands.

Command                           What this command does....
ls                                This command will list all of the files and directories within the
                                  current directory.
cd <directory>                    This command will change your current directory to the
                                  directory you specify. An example would be that "cd
                                  public_html" would take you into your public_html directory.
mv <filename> <location>          This command will move a file from its current location within
                                  the current directory to the directory you specify. For example,
                                  let's say you are in your public_html directory and you want to
                                  move the file "links.cgi" into your "cgi-local" directory. At the
                                  prompt type "mv links.cgi cgi-local.

chmod XXX <filename or            This command will set the permissions on a file or directory to
directory>                        whatever you specify. The "XXX" would be replaced by actual
                                  numbers, such as 644. For example, if we wanted to set the
                                  permissions on our links.cgi file in our cgi-local directory, we
                                  would first go into that directory then type "chmod 755
                                  links.cgi" at the prompt.

rm <filename or directory>        This command will delete the filename or directory you specify
                                  in the current directory. If we wanted to remove the directory
                                  named "user", we would type "rm user" at the prompt.

man <command>                     This is one of the most helpful commands for new users. It
                                  allows you to see all of the different options for a particular
                                  command. For example, if were were to type "man ls", we
                                  would then see all of the different options available for the list
                                  (ls) command.
traceroute <domain>                  This command will perform a traceroute on a particular virtual
                                     domain to see how many hops it takes to get from your
                                     location to the domain specified. An example would be
                                     "traceroute", which would show us how long it
                                     takes for packets to get to and how they get there.

whois <domain>                       This command will display the current InterNIC record
                                     including administrative, technical, and billing contact for a
                                     particular domain if it is already owned.

Using PICO in Telnet.

Pico is a very basic editor used in Telnet. Although basic, it is very useful in that you can edit your
HTML files, CGI scripts, and any other ASCII files without downloading them from the server,
making the changes, then uploading them once again.

Pico is used in the following manner: type in "pico <filename>" at the prompt. For example, let's
say we wanted to edit a line in our links.cgi file. We would need to get into the directory where
that file resides and type in "pico links.cgi" at the prompt. Now a screen would appear with our
links.cgi file.

Once you are finished making the changes to a file, press <Ctrl><X> at the same time. Pico will
ask you if you wish to "Save modified buffer" (in plain English, save the changes). Type "y" if you
want the changes saved or "n" if you want the changes ignored. If you typed in "y" it will then ask
you "File name to write:", which means the file name to save the changes to; the default value is
the file we originally edited (in this case, links.cgi). So you can save the changed file to a different

For more information on Pico, visit the following URL:

Talking to other users on Telnet.

To talk to any user on the system, just type "talk login" where login is the actual login of the user
you want to talk to. If the user accepts your chat request, a divided screen will appear and you
two will be able to chat.

Testing your CGI scripts through Telnet.

One of the most powerful features of Telnet is that you can pinpoint problems in your CGI scripts.
Unlike the HTTPD protocol which displays the infamous "Internal Server Error" message, telnet
will tell you what is the real problem!

To test your script, you must execute it on the server, which means your permissions must allow
you (the user) to execute the script. Otherwise, a permission denied message will occur.

Go into the directory where the script you wish to test resides. Let's say that the CGI script named
"links.cgi" is giving us problems! To find the problem, type in "./links.cgi". The server will then
execute the script and tell you what, if any, problems occur. The syntax for this command is
After you have found the problem, you can edit your CGI script using PICO in Telnet, then test it
again. Eventually you will get your script working, and much faster than trying to pinpoint the
problem yourself!

To top