I'm experiencing strange behavior with a Cisco UC520 router.

When I am directly connected to the router and telnet to it using this:

telnet 23

Then I get a successful login prompt:

Connected to
Escape character is '^]'.
Cisco Configuration Assistant. Version: 3.0. Fri Jan 14 11:35:39 EST 2011

User Access Verification


However, when forward the port remotely to another machine:

ssh root@another_machine -R

And then on that other machine try and connect to the router via telnet:

telnet 23

I get a different message, and immediately disconnected:

Connected to
Escape character is '^]'.
Connection closed by foreign host.

This seemed really odd so I double checked to make sure I was port forwarding port 23 and not port 22. I also tried mapping the router's name in the /etc/hosts file of the computer I forwarded ports to, so that I could do telnet RouterName 23 in case it didn't like the hostname. I also tried using a different forwarding port (10023) which did not work.

I don't see anything in the man page for telnet that indicates there is a --verbose option like ssh -v would give, which would be my next step in debugging. I don't see any problems in any of the /var/log/ files on the machine that the ports are forwarded to.

This seems quite strange and I think what is happening is that somehow the router thinks I'm trying to make an SSH connection instead of a telnet connection.

  • not a definitive answer, but in first case you use telnet protocol, while in second case you use ssh protocol. maybe cisco OS listen both on port 22 and 23, but is able to handle telnet: and ssh: protocol. – Archemar Oct 21 '14 at 5:12
  • @Archemar - you misunderstood. The ssh command is forwarding port 23 to a remote machine, on which I'm executing telnet – cwd Oct 22 '14 at 1:39

Cisco routers has Telnet open by default. You have to explicitly make the configuration for SSH (set a domain, generase RSA, enable SSH 2.0 etc).

Read the Cisco's documentation about how to configure Cisco and SSH.

  • Both are enabled, I would like to know how the router can tell that something is different about the second connection ( which is why I believe it is trying to provide an SSH connection instead of the telnet connection ) – cwd Oct 22 '14 at 1:42
  • Found transport preferred from here which helped - and seems I may have also had a typo on the config – cwd Oct 22 '14 at 4:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.