# Protocol mismatch issue during telnet



## sriarunan

telnet ftp.jtr.com 22
Connecting To ftp.jtr.com...

SSH-1.99-OpenSSH_5.8p1+sftpfilecontrol-v1.3-hpn13v7
Protocol mismatch.


Connection to host lost.


----------



## SpywareDr

Shouldn't that be on port 23, (instead of 22)?


----------



## Wand3r3r

FTP uses 20-22. Telnet uses port 23 as pointed out by SpywareDr

List of TCP and UDP port numbers - Wikipedia, the free encyclopedia


----------



## sriarunan

Thanks for getting backing to the query. 

Remote SFTP server recently got migrated to new host. As part of this change, Remote server had firewall block, I worked with them and opened the firewall port to my host in their end. For validation i tried to do ping, it worked fine. But when i do sftp or telnet am getting this error


My SSH version is SSH Tectia Client 4.0.4
Remote server version is OpenSSH_5.8p1

I like to know whether this issue is happening because of SSH version compatibility.


----------



## SpywareDr

Note that you can't "ping" a port per say as that is ICMP, not UDP or TCP where ports are established.


Since the prefix is 'ftp', what happens if you try:*telnet ftp.jtr.com 21
*​


----------



## Fjandr

Telnet and SSH are different protocols. You cannot access an SSH server using a telnet client, unless that client also supports SSH. And yes, port 22 is correct for SSH unless it's set up to use a non-standard port.

It may be a version mismatch, since SFTP tunnels an FTP connection through an SSH connection and should connect correctly. Try changing the SSH connection version in your client software to see if it will connect with only a specific version (usually later versions prevent connections using previous versions due to security issues).


----------



## SpywareDr

{!-- begin screencap --}


Code:


Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Windows\system32>[COLOR=red][B]telnet ftp.jtr.com 21[/B][/COLOR]
Connecting to ftp.jtr.com ...
220-
220-######################################################################
220-Welcome to your FTP server!
220-
220-Root login via FTP is disallowed by default. Please use an SFTP client
220-(or other secure protocol such as SSH) to connect as root for file
220-transfers.
220-
220-If you are in a country that does not allow strong encryption or have
220-other problems connecting via a secure protocol, you may enable FTP
220-logins for root by adding the following line to /etc/proftpd.conf
220-file:
220-
220-    RootLogin on
220-
220-Logging in to your server via non-secure protocols such as FTP is
220-considered dangerous because potential snoopers on your network may
220-be eavesdropping and obtain your account password, giving them full
220-control of the compromised account.
220-######################################################################
220-
220 222.146.57.113 FTP server ready
[COLOR=red][B]quit[/B][/COLOR]
221 Goodbye.

Connection to host lost.

C:\Windows\system32>

{!-- end screencap --}


----------



## Fjandr

The command line telnet in Windows cannot connect via SSH. You need to use an SSH client such as PuTTY.


----------



## SpywareDr

Got it, thanks.


----------

