Telnet lessons – Part 2

Telnet lessons – Part 2

The simplest use of telnet is to log into a remote computer. Give the command:

C:/>telnet (substituting the name of the computer you want to telnet into for

If this computer is set up to let people log into accounts, you may get the message:


Type your user name here, making sure to be exact. You can’t swap between lower case and capital letters.
For example, user name Guest is not the same as guest.

Newbie note: Lots of people email me asking how to learn what their user name and password are.
Stop laughing, darn it, they really do. If you don’t know your user name and password, that means whoever
runs that computer didn’t give you an account and doesn’t want you to log on.

Then comes the message:


Again, be exact in typing in your password.

What if this doesn’t work?

Every day people write to me complaining they can’t telnet. That is usually because they try to telnet into a computer,
or a port on a computer that is set up to refuse telnet connections. Here’s what it might look like when a computer
refuses a telnet connection:

C: >telnet
Connecting To…Could not open connection to the host, on port 23.
A connection attempt failed because the connected party did not properly respond after a period of time,
or established connection failed because connected host has failed to respond.
Or you might see:

C: >telnet
Connecting To…Could not open connection to the host, on port 23. No connection could be
made because the target machine actively refused it.

If you just give the telnet command without giving a port number, it will automatically try to connect on port 23,
which sometimes runs a telnet server.

If telnet failed to connect, possibly the computer you were trying to telnet into was down or just plain no longer in existence.
Maybe the people who run that computer don’t want you to telnet into it.

Even though you can’t telnet into an account inside some computer, often you can get some information back or
get that computer to do something interesting for you. Yes, you can get a telnet connection to succeed – without doing
anything illegal – against almost any computer, even if you don’t have permission to log in.
There are many legal things you can do to many randomly chosen computers with telnet. For example:

C:/telnet 22


That tells us the target computer is running an SSH server, which enables encrypted connections
between computers. If you want to SSH into an account there, you can get a shell account for free at . You can get a free SSH client program from .

Sometimes a port is running an interesting program, but a firewall won’t let you in. For example,,
a computer on my local area network, runs an email sending program,
(sendmail working together with Postfix, and using Kmail to compose emails).
I can use it from an account inside to send emails with headers that hide from where I send things.
If I try to telnet to this email program from outside this computer, here’s what happens:

C:>telnet 25
Connecting To…Could not open connection to the host, on port 25.
No connection could be made because the target machine actively refused it.

However, if I log into an account on and then telnet from inside to port 25, here’s what I get:

Last login: Fri Oct 18 13:56:58 2002 from
Have a lot of fun…
cmeinel@test-box:~> telnet localhost 25
Trying ::1…
telnet: connect to address ::1: Connection refused
Trying… [Carolyn’s note: is the numerical address meaning localhost,
the same computer you are logged into]
Connected to localhost.
Escape character is ‘^]’.
220 test-box.local ESMTP Postfix

The reason I keep this port 25 hidden behind a firewall is to keep people from using it to try to break in or to forge email.
Now the uber-geniuses reading this will start to make fun of me because no Internet address that begins with 10.
is reachable from the Internet. However, sometimes I place this “test-box” computer online with a static
Internet address,
meaning whenever it is on the Internet, it always has the same numerical address.
I’m not going to tell you what its Internet address is because I don’t want anyone messing with it.
I just want to mess with other people’s computers with it, muhahaha.
That’s also why I always keep my Internet address from showing up in the headers of my emails.
Want a computer you can telnet into and mess around with, and not get into trouble no matter what you do to it?
I’ve set up my ( with user xyz, password guest for you to play with.
Here’s how to forge email to using telnet. Start with the command:

C:>telnet 25
Connecting To

220 <> Service ready

Now you type in who you want the message to appear to come from:

helo will answer:

250 <> host ready

Next type in your mail from address:


250 Requested mail action okay, completed

Your next command:

250 Requested mail action okay, completed

Your next command:
354 Start main input; end with <CRLF>.<CRLF>

How To Telnet Lessons Series:

1 thought on “Telnet lessons – Part 2”

  1. C:\>telnet 25
    connecting to…Could not open connection to the host on port 25:Connect failed.
    this is what i get.could you help me with this?

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.