Getting Started with SSH/Telnet

You’re probably already familiar with the process of making a dial-up PPP connection to the Internet from your Windows PC or Macintosh. Once connected, you then run client software to access various Internet services: a web client (like Netscape Navigator) to access web sites, a mail client (like Netscape’s mail reader, or Eudora) to send and receive email, or an FTP client (like WS_FTP or Fetch) to transfer files. Traditionally, a Telnet client is just another piece of software that runs on top of your Internet connection. You use Telnet to log into a shell session on a remote server. Once you’re in the shell session, you type text commands into the Telnet window, and those commands are then executed on the remote server and the results sent back to you.

We’ll talk more about shell sessions. For now, let’s talk a bit more about Telnet.

There’s an inherent problem with using Telnet to connect to a remote server. Because Telnet traffic is sent across the network unencrypted, a malicious user located on a network somewhere along the path between you and the web server could easily obtain your username and password and use them to connect to the server as you. For that reason, a growing number of ISPs don’t allow customers to make Telnet connections to their servers. Instead, they require customers to use something called ssh (for secure shell), an encrypted protocol that makes it much harder for bad guys to get hold of your login information. Once you’ve established the connection, an ssh session looks the same from the user perspective as a Telnet session: you get a shell window, where you type in commands and see the results of those commands printed out afterward.

I strongly encourage you to use ssh instead of Telnet. If your ISP doesn’t support ssh connections you may have no choice but to use straight Telnet, but in that case you’d probably be well-served to start looking for another ISP.

In order to use ssh (or, if you must, Telnet), you will need a suitable client program. If you’re running Windows, you already have one because Windows comes with a Telnet client preinstalled. I’ve never been happy with the Windows Telnet client, though, and can’t recommend it (even without considering the security implications). Instead, I suggest you to go to your favorite software-download site (like TUCOWS, at http://www.tucows.com/), and get something better. I’ve had good luck with a shareware Telnet program called CRT, and likewise have had good experiences with a slightly more expensive but ssh-capable version of it called SecureCRT ( http://www.vandyke.com/products/securecrt/). For Windows users on a budget, a free ssh client program called PuTTY is also available (http://www.chiark.greenend.org.uk/~sgtatham/putty/).

For Macintosh users, a third-party program called NiftyTelnet (http://andrew2.andrew.cmu.edu/dist/niftytelnet.html) gets high marks from my Mac-using friends (among its other attributes, it supports ssh). For Mac users running OS X, a command-line ssh client (called ssh, cleverly enough) comes with the operating system.

The following discussion presents a simple, idealized example of how you log into a Unix shell session. The specifics of your own login process may be different, depending on what client program, protocol, and connection method you are using. Consult your client program documentation and proceed accordingly.

Once you have your ssh (or Telnet) client software, you need three pieces of information, most likely provided by your ISP:

Whichever client program you’re using, start it up. Once you’re running the client program, some poking around in the menus should reveal a command that lets you Connect... or Connect to remote host... or words to that effect. Choose that command, and in the dialog box that comes up enter the hostname of the computer you want to connect to. Hit the Connect button (or whatever it’s called), and in a few seconds you should see something like the following:

login:

Type your login name (taking note of the fact that on Unix systems, login names, along with most other things you’re going to be typing in, are case sensitive, so jbc is different from Jbc, which is different from JBC). Anyway, type in your login name, and press the Enter key. The next thing you see should be:

password:

Now type in your password (to protect you from shoulder-surfing snoops, the characters won’t display on your screen, so type carefully) and press the Enter key. With any luck, you’ll see something like the following:

Last login: Wed Feb 24 23:32:24 1999 from pm4-37.sba1.avtel.net
[jbc@andros jbc]$

That cryptic-looking last line is called a shell prompt . Yours may look different to a greater or lesser extent, depending on how your server and user account have been configured; it may be as simple as a single percent symbol or dollar sign:

$

Regardless, you’re now in business.

Get Perl for Web Site Management now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.