Register to post in forums, or Log in to your existing account

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion

Joined: 25 Sep 2000
Posts: 23377
Location: Colorado, USA

PostPosted: Tue Jun 26, 2007 11:24 pm   

SSH vs Telnet question
I've got the beginnings of the SSH support in CMUD working. It's pretty basic, but it allows me to test various SSH implementations.

One thing that I've noticed right away is that SSH is echoing the command text to the screen, and it's also giving me double-spaced lines. I'm going to investigate this more tomorrow, but I was wondering if any SSH experts can help with any info on how SSH differs from Telnet (other than the obvious encryption).

For example, does Telnet Option negotiation still work via SSH? Can I tell the server not to use local echoing via a telnet option? Does SSH use a different newline than Telnet? Telnet normally requires a CR/LF at the end of each line. Is SSH the same?

I did some basic Google searching on this, but all I could find on the differences between Telnet and SSH was the encryption. Nobody is talking about low-level details such as Telnet Option negotiation.
Reply with quote
Nick Gammon

Joined: 08 Jan 2001
Posts: 255
Location: Australia

PostPosted: Wed Jun 27, 2007 6:23 am   
I'm no expert on SSH, but I can point you to this page:

In that I describe how I got MUSHclient to "tunnel" through the described program to access a SSH MUD.

My first comment on what you are trying to do is "don't bother" because anyone can use that technique - it isn't specific to a particular client.

However if you want to go ahead, the way I read it is that Telnet is a layer on top of SSH - so you would still use the normal telnet options, once the data stream is decrypted, but I could be wrong.
Reply with quote

Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Wed Jun 27, 2007 1:40 pm   
I don't know anything about SSH but this is from the ietf

Lehtinen & Lonvick Standards Track [Page 11]
RFC 4250 SSH Protocol Assigned Numbers January 2006

52 XCASE Enable input and output of uppercase
characters by preceding their lowercase
equivalents with "\".
53 ECHO Enable echoing.
54 ECHOE Visually erase chars.
55 ECHOK Kill character discards current line.
56 ECHONL Echo NL even if ECHO is off.
57 NOFLSH Don't flush after interrupt.
58 TOSTOP Stop background jobs from output.
59 IEXTEN Enable extensions.
60 ECHOCTL Echo control characters as ^(Char).
61 ECHOKE Visual erase for line kill.
62 PENDIN Retype pending input.
70 OPOST Enable output processing.
71 OLCUC Convert lowercase to uppercase.
72 ONLCR Map NL to CR-NL.
73 OCRNL Translate carriage return to newline
74 ONOCR Translate newline to carriage
return-newline (output).
75 ONLRET Newline performs a carriage return
90 CS7 7 bit mode.
91 CS8 8 bit mode.
92 PARENB Parity enable.
93 PARODD Odd parity, else even.

128 TTY_OP_ISPEED Specifies the input baud rate in
bits per second.
129 TTY_OP_OSPEED Specifies the output baud rate in
bits per second.
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote

Joined: 25 Sep 2000
Posts: 23377
Location: Colorado, USA

PostPosted: Wed Jun 27, 2007 5:50 pm   
Oh, right, the RFCs...why didn't I think of that Embarassed

Now that I have looked at a few of the SSH RFCs, it's clear that SSH is *very* different from Telnet. No Telnet options or anything like that. The terminal opcodes mentioned above are sent in the initial SSH Shell creation messages. I have figured out how to set these opcodes and will play with them today.

Nick: The reason I'm implementing SSH in CMUD-Pro is because it has been requested by many people. It will also be part of our commercial TeSSH product, which is CMUD-Pro minus some of the MUD-specific stuff (like the mapper, MUD list, etc). Even though it is possible to tunnel any MUD client via a program like PuTTY, many people have asked for this functionality to be directly integrated into CMUD itself. Some people don't like messing with tunnels and stuff like that.

There used to be licensing problems with SSH, which is why zMUD never had it. Those issues seem to be gone these days (as long as you don't use the IDEA algorithm), so now it's feasible to add support directly into CMUD. But I'm only including SSH in the CMUD-Pro version so that people who don't want/need SSH don't need to pay for it.
Reply with quote

Joined: 25 Sep 2000
Posts: 23377
Location: Colorado, USA

PostPosted: Wed Jun 27, 2007 8:54 pm   
I made some good progress on this today. It looks like the main (default) differences between Telnet and SSH are:
  • Telnet: Input from command line always terminates in CR/LF. SSH: Input from command line terminates with just LF.
  • Telnet: sends CR NUL when it wants just a carriage return. SSH: Just sends the CR without the NUL character

Those are the main differences that seem to effect the terminal emulation. Using the SSH opcode IGNCR (ignore CR) I can get it to ignore the CR in the CR/LF from the command line, but this only works at the shell level. When you run something like the "vi" editor, then vi takes the CR/LF directly and causes double-spacing. So, I am filtering the CR/LF within CMUD itself and changing it to just send LF when in SSH mode.

The difference with the CR NUL on data sent from the server is a bit trickier. That's in the VT100 emulation code within CMUD. This code also handles those cases where the MUD only sends a LF, or only a CR, or sends LF/CR instead of CR/LF. It was easy to recognize CR NUL as a plain CR character, but with the SSH not sending the NUL character, it's going to take some careful work to handle this.

Except for that last detail, the SSH in CMUD seems to be working well with the SSHBlackBox components. So I'm going ahead and purchasing these components and will then start adding all of the options and preferences to control the SSH connection. The first version of CMUD-Pro probably won't have any port forwarding in it (although the BlackBox components *do* support this). I'll want to let people play with the basic SSH implementation before I start adding anything really fancy like forwarding or command tunnels.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by