Wednesday, December 05, 2007

Dev : Telnet-ing

A simple tips to share to everyone. As we know, each program that dwells through the network will be communicating through a certain specific port. For example, MSSQL2000 is using port 1433, SMTP is using port 25 and ssh is using port 22.

If we fail to connect, lets say, the mail server of the company, we can actually do a quick check on the problem. Using windows telnet to connect to the network port would be a great start. It will just take a couple of steps to check on the SMTP port of the mail server. Although telnet is defaulted to connect to port 23, but with an additional parameter, we can also telnet to any desire port.

Steps (Make sure your firewall is off and network is up for clearer picture)
1. Open your Command Prompt (Start --> Run --> cmd).
2. Type telnet mailserver 25.
3. If you receive such message Connecting To mailserver...Could not open connection to the host, on port 25: Connect failed, this means most probably the mail server itself is down or maybe the mailserver daemon is not running. Daemon is a small program running in the background either waiting for command or run on its own on a specific port.
4. If you success, you will be brought to a new blank page (normally). This means the mailserver and port is running fine. You will need to check your mail browser instead. Press keyboard ctrl+] to disconnect the telnet.
5. Type quit to exit the windows telnet.

This is very useful, esspecially if you are trying to set up a program such as Apache webserver but you are not sure whether it is running fine or not. You can try connect Apache webserver on the local machine by using telnet localhost 80.

*Keep in mind that normal telnet is telnet ip_or_hostname_of_machine. Telnet checking should be telnet ip_or_hostname_of_machine port_used.

1 comment:

Unknown said...

OMG! Matrix Code again! Pening!