Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH connection to Cisco switch automatically closed by switch after successful connection #3415

Open
TheOtherGuy opened this issue Feb 19, 2025 · 0 comments

Comments

@TheOtherGuy
Copy link

TheOtherGuy commented Feb 19, 2025

I am connecting to the Cisco Catalyst switch via a proxy server. The connection works, but the SSH connection is disconnected shortly by the switch: DEBUG -- : 10.0.1.4 raised Net::SSH::Disconnect with msg "connection closed by remote host".

I can connect to the Cisco switch from the Oxidized Docker container via the proxy server.

There appears to be no issue with SSH key negotiation.

I am using the latest version of Oxidized, version 0.32.

Below is the Oxidized log:

I, [2025-02-19T08:10:10.020837 #33]  INFO -- : Oxidized starting, running as pid 33
I, [2025-02-19T08:10:10.023213 #33]  INFO -- : lib/oxidized/nodes.rb: Loading nodes
D, [2025-02-19T08:10:10.023376 #33] DEBUG -- : resolving DNS for CriSW...
D, [2025-02-19T08:10:10.023401 #33] DEBUG -- : IPADDR 10.0.1.4
D, [2025-02-19T08:10:10.023471 #33] DEBUG -- : node.rb: resolving node key 'model', with passed global value of '' and node value 'ios'
D, [2025-02-19T08:10:10.023489 #33] DEBUG -- : node.rb: setting node key 'model' to value 'ios' from node
D, [2025-02-19T08:10:10.023520 #33] DEBUG -- : lib/oxidized/node.rb: Loading model "ios"
D, [2025-02-19T08:10:10.028624 #33] DEBUG -- : lib/oxidized/model/model.rb Added all to the commands list
D, [2025-02-19T08:10:10.028659 #33] DEBUG -- : lib/oxidized/model/model.rb Added secret to the commands list
D, [2025-02-19T08:10:10.028676 #33] DEBUG -- : lib/oxidized/model/model.rb Added show version to the commands list
D, [2025-02-19T08:10:10.028689 #33] DEBUG -- : lib/oxidized/model/model.rb Added show vtp status to the commands list
D, [2025-02-19T08:10:10.028700 #33] DEBUG -- : lib/oxidized/model/model.rb Added show inventory to the commands list
D, [2025-02-19T08:10:10.028879 #33] DEBUG -- : node.rb: resolving node key 'input', with passed global value of 'ssh' and node value ''
D, [2025-02-19T08:10:10.028906 #33] DEBUG -- : node.rb: setting node key 'input' to value 'ssh' from passed global value
D, [2025-02-19T08:10:10.489082 #33] DEBUG -- : node.rb: resolving node key 'output', with passed global value of 'git' and node value ''

D, [2025-02-19T08:10:10.489141 #33] DEBUG -- : node.rb: setting node key 'output' to value 'git' from passed global value
D, [2025-02-19T08:10:10.661121 #33] DEBUG -- : node.rb: resolving node key 'username', with passed global value of '' and node value 'ox
idized'
D, [2025-02-19T08:10:10.661197 #33] DEBUG -- : node.rb: setting node key 'username' to value 'oxidized' from node
D, [2025-02-19T08:10:10.661216 #33] DEBUG -- : node.rb: resolving node key 'password', with passed global value of '' and node value 'Ap
ple123#'
D, [2025-02-19T08:10:10.661227 #33] DEBUG -- : node.rb: setting node key 'password' to value 'passwordx' from node
I, [2025-02-19T08:10:10.661379 #33]  INFO -- : lib/oxidized/nodes.rb: Loaded 1 nodes
D, [2025-02-19T08:10:11.658620 #33] DEBUG -- : lib/oxidized/core.rb: Starting the worker...
D, [2025-02-19T08:10:11.662647 #33] DEBUG -- : lib/oxidized/worker.rb: Jobs running: 0 of 1 - ended: 0 of 1
D, [2025-02-19T08:10:11.671745 #33] DEBUG -- : lib/oxidized/worker.rb: Added /CriSW to the job queue
D, [2025-02-19T08:10:11.671814 #33] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2025-02-19T08:10:11.672467 #33] DEBUG -- : lib/oxidized/job.rb: Starting fetching process for CriSW at 2025-02-19 08:10:11 U
TC
D, [2025-02-19T08:10:11.673054 #33] DEBUG -- : lib/oxidized/input/ssh.rb: I/O Debuging to /home/oxidized/.config/oxidized/logs/10.0.1.4-ssh
D, [2025-02-19T08:10:11.673125 #33] DEBUG -- : lib/oxidized/input/ssh.rb: Connecting to CriSW
D, [2025-02-19T08:10:11.675930 #33] DEBUG -- : AUTH METHODS::["publickey", "keyboard-interactive", "password","none"]
D, [2025-02-19T08:10:11.692200 #33] DEBUG -- net.ssh.transport.session[7a8]: establishing connection to 10.0.1.4:22 through proxy
D, [2025-02-19T08:10:11.895542 #33] DEBUG -- net.ssh.transport.session[7a8]: connection established
I, [2025-02-19T08:10:11.895663 #33]  INFO -- net.ssh.transport.server_version[7e4]: negotiating protocol version
D, [2025-02-19T08:10:11.895685 #33] DEBUG -- net.ssh.transport.server_version[7e4]: local is `SSH-2.0-Ruby/Net::SSH_7.3.0 x86_64-linux-gnu'
D, [2025-02-19T08:10:11.895742 #33] DEBUG -- net.ssh.transport.server_version[7e4]: remote is `SSH-2.0-Cisco-1.25'
I, [2025-02-19T08:10:11.896293 #33]  INFO -- net.ssh.transport.algorithms[7f8]: sending KEXINIT
D, [2025-02-19T08:10:11.896451 #33] DEBUG -- io[80c]: queueing packet nr 0 type 20 len 1572
D, [2025-02-19T08:10:11.896491 #33] DEBUG -- io[80c]: sent 1576 bytes
D, [2025-02-19T08:10:11.899927 #33] DEBUG -- io[80c]: read 248 bytes
D, [2025-02-19T08:10:11.900078 #33] DEBUG -- io[80c]: received packet nr 0 type 20 len 244
I, [2025-02-19T08:10:11.900135 #33]  INFO -- net.ssh.transport.algorithms[7f8]: got KEXINIT from server
I, [2025-02-19T08:10:11.900198 #33]  INFO -- net.ssh.transport.algorithms[7f8]: negotiating algorithms
D, [2025-02-19T08:10:11.900310 #33] DEBUG -- net.ssh.transport.algorithms[7f8]: negotiated:
* kex: ecdh-sha2-nistp521
* host_key: ssh-rsa
* encryption_server: aes256-ctr
* encryption_client: aes256-ctr
* hmac_client: hmac-sha2-512
* hmac_server: hmac-sha2-512
* compression_client: none
* compression_server: none
* language_client:
* language_server:
D, [2025-02-19T08:10:11.900344 #33] DEBUG -- net.ssh.transport.algorithms[7f8]: exchanging keys
D, [2025-02-19T08:10:11.900947 #33] DEBUG -- io[80c]: queueing packet nr 1 type 30 len 148
D, [2025-02-19T08:10:11.901002 #33] DEBUG -- io[80c]: sent 152 bytes
D, [2025-02-19T08:10:12.548698 #33] DEBUG -- io[80c]: read 804 bytes
D, [2025-02-19T08:10:12.590490 #33] DEBUG -- io[80c]: read 436 bytes
D, [2025-02-19T08:10:12.590675 #33] DEBUG -- io[80c]: received packet nr 1 type 31 len 1220
D, [2025-02-19T08:10:12.593811 #33] DEBUG -- io[80c]: queueing packet nr 2 type 21 len 20
D, [2025-02-19T08:10:12.593888 #33] DEBUG -- io[80c]: sent 24 bytes
D, [2025-02-19T08:10:12.593960 #33] DEBUG -- io[80c]: received packet nr 2 type 21 len 12
D, [2025-02-19T08:10:12.594417 #33] DEBUG -- net.ssh.authentication.session[820]: beginning authentication of `oxidized'
D, [2025-02-19T08:10:12.594662 #33] DEBUG -- io[80c]: queueing packet nr 3 type 5 len 28
D, [2025-02-19T08:10:12.594711 #33] DEBUG -- io[80c]: sent 96 bytes
D, [2025-02-19T08:10:12.597807 #33] DEBUG -- io[80c]: read 96 bytes
D, [2025-02-19T08:10:12.597966 #33] DEBUG -- io[80c]: received packet nr 3 type 6 len 28
D, [2025-02-19T08:10:12.598062 #33] DEBUG -- net.ssh.authentication.session[820]: trying publickey
D, [2025-02-19T08:10:12.598427 #33] DEBUG -- net.ssh.authentication.agent[834]: connecting to ssh-agent
E, [2025-02-19T08:10:12.598518 #33] ERROR -- net.ssh.authentication.agent[834]: could not connect to ssh-agent: Agent not configured
D, [2025-02-19T08:10:12.598644 #33] DEBUG -- net.ssh.authentication.methods.publickey[85c]: trying publickey (03:56:h6:44:67:4h:aa:e1:a2
:91:1e:22:25:c9:g7:82) alg rsa-sha2-256
D, [2025-02-19T08:10:12.598830 #33] DEBUG -- io[80c]: queueing packet nr 4 type 50 len 364
D, [2025-02-19T08:10:12.598884 #33] DEBUG -- io[80c]: sent 432 bytes
D, [2025-02-19T08:10:12.600000 #33] DEBUG -- io[80c]: read 368 bytes
D, [2025-02-19T08:10:12.600118 #33] DEBUG -- io[80c]: received packet nr 4 type 53 len 300
I, [2025-02-19T08:10:12.600171 #33]  INFO -- net.ssh.authentication.session[820]: C
***************************************Info**********************************************

D, [2025-02-19T08:10:12.673016 #33] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2025-02-19T08:10:12.705310 #33] DEBUG -- : 10.0.1.4 raised Net::SSH::Disconnect with msg "connection closed by remote host"
D, [2025-02-19T08:10:12.705411 #33] DEBUG -- : lib/oxidized/node.rb: Oxidized::SSH failed for CriSW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant