Solved

Telnet login

Posted on 1998-10-16
7
255 Views
Last Modified: 2010-08-05
Hi,
I'm wondering what UNIX servers send you when you log on.  I wrote an WinSock program that connects to a UNIX (AIX) server.  When I connect, it sends me three bytes:
FF FD 18
I didn't know what to do so I just echoed them back and it sent me three more bytes:
FF FC 18
So I echoed those back as well.
This was good in that it got me the login string but that string was preceded with about ten bytes of non-ASCII characters.
It was a wild guess that got me to the login prompt but I'd like to know what all of this non-ASCII data represents, I was expecting to just get a bunch of strings, carriage returns, and line-feeds...
This is my first socket program.
I have no experience in sockets or programming for networks, just a lot of reading.
Thanks
0
Comment
Question by:bod_1
7 Comments
 
LVL 1

Expert Comment

by:shirlng
ID: 2007489
Have you checked the Port and the Terminal Type from the Remote System?
0
 
LVL 2

Expert Comment

by:seedy
ID: 2007490
FF indicates the IAC(interpret as command character).  The next few bytes will be the command and any associated options.  Bascially the telnet process on the AIX server is trying to negotiate some options.  Also normally the AIX tries to clear the screen before presenting the login prompt.  This is done by sending a series of 0x0A characters before the prompt.

For more info. on the telnet protocol, please refer to RFC-854.
0
 

Author Comment

by:bod_1
ID: 2007491
Thanks guys,
I the port that I am using is telnet (it is resolved from it's name and corresponding port from some file, I forget it's name right now).  Terminal type ?  Is that what it's doing?  Seeing what kind of terminal I am (dumb, VT...) ?
I got a buch of 0A's (line feed) after that too.  I noticed that while using WS_FTP program, every command echoed to the debug window has a number infront of it.  I suppose these numbers are command codes?
I am looking at RFC now;

Thanks again
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:seedy
ID: 2007492
WS-FTP will display the commands of the protocol FTP.  
You would not want to confuse that with the telnet protocol you are interested in.
0
 

Author Comment

by:bod_1
ID: 2007493
I just installed Linux and got it configured.  man, what I'm looking for will be right on my machine now too.
I have much reading to do.
0
 
LVL 4

Accepted Solution

by:
davidmwilliams earned 50 total points
ID: 2007494
 I just typed a lengthy reply and Experts Exchange erased it because it was too long ! :(  So here's another go ...
  Whenever a client or server wants to send a command sequence instead of normal data, it inserts a special reserved character into the stream ... IAC ... which means 'Interpret as command'.
  Now, when telnet connects to a server, some negotiation goes on.  The two ends can request features of the other, or offer features.  For example, they will negotiate over which side performs echoing.  Also, some systems may offer to transmit characters as 8-bit uncoded bytes.
  The sequence is    IAC  verb  option    where verb is DO or DONT, encoded, and the reply is   IAC  verb  option  where verb here is WILL or WONT.
  What you describe seems to me like your server offered to do echoing, and you then sent the request right back :)  So the second message you received, with the differing byte, is because it then sent you a confirmation to your message, honouring the request you made of it :)
0
 

Author Comment

by:bod_1
ID: 2007495
Cool,
That makes sense.

Thanks for the help guys
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Convert OverPunch 25 67
I need help with in hpux 11.31 ftp script  to upload files from multiple paths in unix to multiple paths 2 74
Oracle Finace 3 94
UNIX SCP 5 87
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question