Hardening the Unpatchable: Bastion Access & Compensating Controls for Legacy Cisco IOS
Layered bastion architecture isolating legacy Cisco IOS
12.2(55)EX SSH behind Tailscale WireGuard, host-scoped OpenSSH on minty-access (10.1.1.20), Cisco VTY ACLs, and OPNsense VLAN isolation.
Hello everyone,
In a previous blog post, I detailed integrating a Cisco Catalyst 3560-CG (SW-CORE-01) Layer 3 switch into my Proxmox-based home lab. The switch runs Cisco IOS 12.2(55)EX, which is rock-solid for Layer 2/3 switching, but its SSH daemon is stuck on legacy cryptography (SHA-1 key exchange, ssh-rsa host keys, and CBC ciphers) that modern OpenSSH clients refuse by default. In this post, I walk through how I addressed accessing this piece of legacy enterprise hardware securely without weakening my workstations or exposing my home lab to unnecessary risk.
In a real production network, you cannot always throw away end-of-support switches, UPS cards, or management controllers overnight—and you definitely should not weaken SSH settings globally on your workstation just to reach one old device.
Instead, I solved this the same way infrastructure and Privileged Access Management (PAM) teams do: wrap the legacy control plane in layered compensating controls. Here is how I locked down SSH access to SW-CORE-01 using a Tailscale-connected Linux jump host (minty-access), host-scoped OpenSSH rules, and Cisco VTY access lists.
The Reality of Legacy Enterprise Gear
Every enterprise environment has hardware that still does its job reliably long after its management crypto goes stale—warehouse IDF switches, out-of-band iDRACs, PDU controllers, or older Cisco IOS gear like this Catalyst 3560-CG.
When modern OpenSSH tries to connect to IOS 12.2(55)EX, the handshake fails immediately because modern clients reject diffie-hellman-group1-sha1, CBC ciphers, and ssh-rsa signatures. Most quick fixes you find online tell you to edit /etc/ssh/ssh_config globally and re-enable weak algorithms across the entire machine.
That is an anti-pattern. Weakening SSH globally lowers the security floor for every modern Linux host and cloud server you touch, and it still leaves the switch's port 22 exposed across your network.
If you cannot patch the cryptography on the device—which is the situation in my case—you control where that traffic can travel and who is allowed to talk to it.
Layered Bastion Architecture
Instead of connecting directly from my workstation to the switch, all administrative sessions flow through minty-access—a dedicated Linux VM (VM 109 on lab01, static management IP 10.1.1.20) that I already use to administer my OPNsense gateway and core lab services. It sits right beside SW-CORE-01 (10.1.1.9) on the native management plane.
| Security Layer | Control Applied | Risk Mitigated |
|---|---|---|
Remote Hop (Laptop → minty-access) | Tailscale (WireGuard) + modern OpenSSH (Ed25519 / Curve25519) | Legacy SSH cryptography never leaves the local rack or crosses the WAN. |
Jump Host Client (minty-access → 10.1.1.9) | User-level ~/.ssh/config scoped strictly to 10.1.1.9, ForwardAgent no, pinned known_hosts | Global SSH defaults remain hardened; prevents agent hijacking and LAN MITM. |
Switch Control Plane (SW-CORE-01 VTY) | ip access-list standard MGMT-SSH-ONLY + access-class + deny any log + login block-for | Drops TCP port 22 traffic from every host except minty-access; rate-limits brute force. |
| Network Segmentation (OPNsense) | VLAN 30 & VLAN 40 firewall rules blocking 10.1.0.0/16 | Endpoint and container VLANs cannot route to the management subnet at all. |
| Physical Failsafe | Serial console (line con 0 / COM10) | Guaranteed out-of-band recovery if a VTY ACL or trunk change goes sideways. |
Step 1: Host-Scoped SSH on the Jump Host
Before configuring the client on minty-access, I probed SW-CORE-01 with the SSH command below to see the exact algorithms the IOS 12.2(55)EX SSH server advertises. This allows us to enable only the strongest ones it actually supports while excluding deprecated options like 3des-cbc and hmac-md5:
# Inspect exact KEX, host key, cipher, and MAC algorithms offered by SW-CORE-01
ssh -vv -o BatchMode=yes dario@10.1.1.9 2>&1 | grep -E "kex:|peer server|cipher|mac"
Probing SW-CORE-01 (10.1.1.9) via ssh -vv to inspect the exact legacy ciphers and MACs advertised by Cisco IOS 12.2(55)EX.
From the peer server KEXINIT proposal output above, SW-CORE-01 advertises:
- Key Exchange:
diffie-hellman-group1-sha1(causing the immediatekex: algorithm: (no match)error) - Ciphers:
aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc(no modern CTR/GCM support—soaes256-cbcis the strongest available) - MACs:
hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96(so we pin strictly tohmac-sha1)
Next, I created a host-specific block inside ~/.ssh/config on minty-access—leaving /etc/ssh/ssh_config and sshd_config completely untouched:
Host sw-core-01 10.1.1.9
HostName 10.1.1.9
User dario
# Exact strongest algorithms advertised by IOS 12.2(55)EX (excludes 3des-cbc & hmac-md5)
KexAlgorithms +diffie-hellman-group1-sha1
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
Ciphers aes256-cbc
MACs hmac-sha1
StrictHostKeyChecking ask
ForwardAgent no
ForwardX11 no
I then locked down the file ownership and permissions with chown and chmod and tested the connection:
sudo chown -R $USER:$USER ~/.ssh
chmod 700 ~/.ssh
chmod 600 ~/.ssh/config
ssh sw-core-01
Fixing ~/.ssh ownership and 600 permissions on minty-access, then connecting via ssh sw-core-01 to permanently pin SW-CORE-01's 2048-bit RSA fingerprint.
If you create ~/.ssh/config with sudo nano and then run sudo chmod 600 ~/.ssh/config, the file ends up owned by root:root with mode 600—locking your own user account out of reading it. OpenSSH will silently skip an unreadable ~/.ssh/config and throw the exact same no matching key exchange method found error. Always ensure ~/.ssh/config is owned by your user (chown $USER:$USER ~/.ssh/config).
Configuration Breakdown
Host sw-core-01 10.1.1.9- Restricts every legacy override strictly toSW-CORE-01and creates a convenient local alias (ssh sw-core-01) without needing DNS; all other SSH sessions fromminty-accesskeep modern defaults.Ciphers aes256-cbc&MACs hmac-sha1- Locks the session strictly to the strongest cipher and MAC that IOS12.2(55)EXsupports (verified in our live probe and switch logs), explicitly rejecting weaker3des-cbc,aes128-cbc, andhmac-md5.StrictHostKeyChecking ask→yes- Accepts and permanently pins the switch's 2048-bit RSA fingerprint into~/.ssh/known_hostson first login; switching toyesafterward ensures SSH aborts immediately if anything tries to spoof10.1.1.9on the LAN.ForwardAgent no/ForwardX11 no- Prevents your SSH agent socket from ever being exposed to an unpatchable remote host.
From my workstation over Tailscale, I can jump straight to the switch without storing legacy SSH settings on my laptop at all:
ssh -t minty-access@minty-access "ssh sw-core-01"
Single-command jump from MobaXterm over Tailscale through
minty-access directly into SW-CORE-01# with zero legacy SSH config on the workstation.
Step 2: Locking Down Cisco VTY Access
Even though we now have a clean jump host, line vty 0 15 on SW-CORE-01 still accepted SSH connections from any IP on 10.1.0.0/16. To enforce true bastion-only management, we restrict VTY access strictly to minty-access's static IP (10.1.1.20) while keeping reload in 10 armed as a zero-lockout safety net:
! Safety net: auto-reverts to saved startup-config in 10 mins if SSH access breaks
reload in 10
configure terminal
! 1. Permit SSH ONLY from minty-access (replace with minty-access's exact static IP)
ip access-list standard MGMT-SSH-ONLY
remark Allow minty-access Jump Host
permit host 10.1.1.20
! Optional fallback for direct Admin Laptop plugged into Gi0/10:
! permit 10.1.2.0 0.0.0.255
deny any log
exit
! 2. Bind ACL to all VTY lines and enforce SSHv2 + idle timeout
line vty 0 15
access-class MGMT-SSH-ONLY in
transport input ssh
exec-timeout 10 0
exit
! 3. Enable SSH audit logging and brute-force lockout protection
ip ssh logging events
login block-for 120 attempts 3 within 60
end
Line-by-Line IOS Breakdown
ip access-list standard MGMT-SSH-ONLY- Explicitly whitelistsminty-access(permit host) and logs every unauthorized connection attempt viadeny any log.access-class MGMT-SSH-ONLY in- Applies the ACL directly to the switch's VTY control plane (0 15), dropping unauthorized TCP port 22 attempts before authentication even starts.ip ssh logging events- Emits syslog entries for every SSH login, logout, and failure.login block-for 120 attempts 3 within 60- Automatically enters a 2-minute quiet mode if 3 failed logins occur within 60 seconds, shutting down brute-force attempts.
Before saving to NVRAM, I opened a second terminal on minty-access to verify ssh sw-core-01 still logged in cleanly, then canceled the safety timer and wrote the configuration to memory:
reload cancel
write memory
Applying MGMT-SSH-ONLY to line vty 0 15 under a 10-minute reload in 10 safety timer, aborting the reload after verification, and saving to NVRAM (write memory [OK]).
Verification: Trust, but Verify
Never assume an ACL works until you test both the allowed path and a denied path. First, I verified bastion access remained intact from minty-access (10.1.1.20) using both the IP address and the sw-core-01 alias. Then, from another Proxmox VM on the same subnet—labservices (10.1.2.162), which hosts helper Docker containers and should never touch switch management—I attempted a direct SSH connection to 10.1.1.9 and received an immediate Connection refused:
Allowed vs. denied verification: minty-access (10.1.1.20) authenticates cleanly to SW-CORE-01#, while unauthorized host labservices (10.1.2.162) is immediately refused on TCP port 22.
Next, now that SW-CORE-01's 2048-bit RSA host key fingerprint was permanently saved in ~/.ssh/known_hosts, I updated ~/.ssh/config on minty-access to change StrictHostKeyChecking from ask to yes:
Locking StrictHostKeyChecking yes inside ~/.ssh/config on minty-access after the switch's RSA key fingerprint was pinned.
Why switch StrictHostKeyChecking from ask to yes? On the initial login, ask prompts you to inspect and save the switch's RSA key fingerprint into ~/.ssh/known_hosts. Once pinned, switching to yes enforces strict verification without interactive prompts—if another device on the LAN ever spoofs 10.1.1.9 (via ARP poisoning or an active man-in-the-middle attack) and presents a mismatched key, OpenSSH aborts immediately rather than giving an admin a prompt to click past. When dealing with older SHA-1 key exchange on legacy IOS, strict host-key pinning is an essential compensating control.
Auditing Switch Counters & Logs on SW-CORE-01
Logging back into the switch from minty-access, I ran the commands below to audit the live ACL counters, SSH version settings, and syslog entries:
show access-lists MGMT-SSH-ONLY
show ip ssh
show logging | include MGMT-SSH-ONLY|SSH
Live SW-CORE-01 audit output showing 10 permit 10.1.1.20 (10 matches), 20 deny any log (2 matches) with %SEC-6-IPACCESSLOGS denying 10.1.2.162, and aes256-cbc / hmac-sha1 negotiation.
That output gives us concrete proof across every layer:
10 permit 10.1.1.20 (10 matches)- Confirms authorized management sessions fromminty-access.20 deny any log (2 matches)+%SEC-6-IPACCESSLOGS: list MGMT-SSH-ONLY denied 10.1.2.162 1 packet- Proves the switch control plane actively dropped and logged both unauthorized attempts fromlabservices.using crypto cipher 'aes256-cbc', hmac 'hmac-sha1' Succeeded- Confirms our host-scoped~/.ssh/confignegotiated the exact strongest cipher and MAC supported by IOS12.2(55)EX, with zero fallback to3des-cbcorhmac-md5.
Final Thoughts
Legacy hardware is a reality in almost every real-world IT environment. When you cannot patch the encryption on an older switch or appliance, you do not lower the security bar across your workstations—you isolate the control plane behind a hardened jump host, scope legacy client settings to a single IP, lock down VTY access with an explicit whitelist ACL, and prove it works in the logs.
With SW-CORE-01 locked down behind minty-access over Tailscale, I used this exact hardened management channel to safely roll out our 802.1Q trunks and segmented VLANs in Home Lab 02: Implementing 802.1Q VLANs & Network Segmentation!
