IOS: Reverse SSH Console Access – Part 2

Accessing the line port using SSH only.

The advantage to this option is that you need only allow TCP 22 (SSH) through your firewall.

From a *nix platform, you use the following command line:

ssh gf:[email protected]

When using putty in interactive mode, at the username prompt just put username:number at the prompt.

Putty Profile

If you configure putty profiles (which I use to run putty from the command line).

putty ssh selecta.jpg

Connecting from the IOS prompt on your terminal server

Accessing a port on your terminal server using the IOS command line, where 40 is the line number of the serial port that you want connect to.

lontrm01#ssh -l gf:40 10.216.4.10

{Thanks to Emanuele who posted a comment on the original post}

HELP: How do you enter Break Characters to enter ROMMON ?

I have not been able to successfully enter a break character / sequence to break into the boot sequence when using Reverse SSH. From my research, it seems that the break characters when using SSH are different from those using telnet.

I am sure that there is an answer – please leave a comment if you have any tips.

List of Standard Break Keys

Other posts in the series

  1. Cisco IOS CLI Regex: sh ip bgp in
  2. IOS CLI Tip: More accurate pipe commands
  3. Cisco Nexus NXOS and Fixing broken “switchto” syntax with alias
  4. show ip eigrp topology all
  5. Cisco IOS CLI Shortcuts
  6. The poor man's IOS Traffic Generator
  7. IOS: "terminal monitor" on, off - logging to your terminal
  8. IOS: Console, Terminal, Monitor, VTY - what is what ?
  9. IOS: Clearing an interface configuration
  10. IOS: Setting Terminal Window Length
  11. IOS CLI: show run linenum
  12. IOS: Setting the TCP timeout on IOS
  13. IOS: enable and .... disable ?
  14. IOS: Reverse SSH console access - Part 2 (This post)
  15. IOS:Open Source Lab DNS and IP addressing
  16. IOS: Reverse SSH console access
  17. ip tcp timestamp
  18. Cisco ASA and IOS command tip - test aaa-server
About Greg Ferro

Greg Ferro is a Network Engineer/Architect, mostly focussed on Data Centre, Security Infrastructure, and recently Virtualization. He has over 20 years in IT, in wide range of employers working as a freelance consultant including Finance, Service Providers and Online Companies. He is CCIE#6920 and has a few ideas about the world, but not enough to really count.

He is a host on the Packet Pushers Podcast, blogger at EtherealMind.com and on Twitter @etherealmind and Google Plus

You can contact Greg via the site contact page.

Comments

  1. Hi Greg,
    I think there is no standard key. On openssh using ~B you ask to remote server to send a BREAK to remote server. But I’m not sure SSHv2 on cisco implement this. I’ve nothing connected to the only reverse SSH box I have, so I can’t test..
    And I see no telnet break-on-ip or ip-on-break for ssh.. :-/

    • I tried ~B on OSX Terminal but it didn’t work. I also activated the ‘telnet -on-break’ but it didn’t work either. The only way I got it to work was to remove the line from the rotary group, telnet (not SSH) as normal, connect a windows keyboard, and open a windows terminal emulator in Parallels. Which isn’t really very good.

  2. Sorry I meant to type “ip ssh break-string” command in the previous post