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

"Unable to connect" via ssh #46

Open
all3vil opened this issue Jul 19, 2023 · 0 comments
Open

"Unable to connect" via ssh #46

all3vil opened this issue Jul 19, 2023 · 0 comments

Comments

@all3vil
Copy link

all3vil commented Jul 19, 2023

Apologies in advance if this isn't the right place to bring this up, but I'm out of ideas without help.

oxs dies with unable to connect but I can't figure out why. Both oxidized and ssh directly both work. My hunch is that it's a Kex (or similar ssh option) mismatch with the switch's ssh offer because I had to add in the necessary options in the oxidized config to make oxidized work, and also the local machine's /etc/ssh/ssh_config in order to make the standard ssh client work. But maybe oxidized-script is ignoring those options? Packet capture confirms it is exchanging a couple ssh packets with the switch, and debugs on the switch just say the client is terminating the session.

I don't really have reason to think this is necessarily a bug or anything, but I'm out of ideas on what to knobs to twiddle and I don't know how to get any more detailed debug out of it as to why it's failing. Any pointers?

Sanitized debug output:

oxidized@librenms:~$ oxs -d X.X.X.X "sh ver"
I, [2023-07-19T13:44:36.917855 #4193427]  INFO -- : lib/oxidized/nodes.rb: Loading nodes
D, [2023-07-19T13:44:36.918009 #4193427] DEBUG -- : resolving DNS for X.X.X.X...
D, [2023-07-19T13:44:36.918033 #4193427] DEBUG -- : IPADDR 
D, [2023-07-19T13:44:36.918087 #4193427] DEBUG -- : node.rb: resolving node key 'model', with passed global value of '' and node value 'ios'
D, [2023-07-19T13:44:36.918104 #4193427] DEBUG -- : node.rb: setting node key 'model' to value 'cisco' from global
D, [2023-07-19T13:44:36.918125 #4193427] DEBUG -- : node.rb: returning node key 'model' with value 'ios'
D, [2023-07-19T13:44:36.918138 #4193427] DEBUG -- : lib/oxidized/node.rb: Loading model "ios"
D, [2023-07-19T13:44:36.919016 #4193427] DEBUG -- : lib/oxidized/model/model.rb Added all to the commands list
D, [2023-07-19T13:44:36.919049 #4193427] DEBUG -- : lib/oxidized/model/model.rb Added secret to the commands list
D, [2023-07-19T13:44:36.919065 #4193427] DEBUG -- : lib/oxidized/model/model.rb Added show version to the commands list
D, [2023-07-19T13:44:36.919095 #4193427] DEBUG -- : lib/oxidized/model/model.rb Added show vtp status to the commands list
D, [2023-07-19T13:44:36.919106 #4193427] DEBUG -- : lib/oxidized/model/model.rb Added show inventory to the commands list
D, [2023-07-19T13:44:36.919116 #4193427] DEBUG -- : lib/oxidized/model/model.rb Added show running-config to the commands list
D, [2023-07-19T13:44:36.919235 #4193427] DEBUG -- : node.rb: resolving node key 'input', with passed global value of 'ssh' and node value ''
D, [2023-07-19T13:44:36.919256 #4193427] DEBUG -- : node.rb: returning node key 'input' with value 'ssh'
D, [2023-07-19T13:44:36.968856 #4193427] DEBUG -- : node.rb: resolving node key 'output', with passed global value of 'git' and node value ''
D, [2023-07-19T13:44:36.968925 #4193427] DEBUG -- : node.rb: returning node key 'output' with value 'git'
D, [2023-07-19T13:44:36.978135 #4193427] DEBUG -- : node.rb: resolving node key 'username', with passed global value of '' and node value ''
D, [2023-07-19T13:44:36.978178 #4193427] DEBUG -- : node.rb: setting node key 'username' to value 'MyUser' from global
D, [2023-07-19T13:44:36.978199 #4193427] DEBUG -- : node.rb: returning node key 'username' with value 'MyUser'
D, [2023-07-19T13:44:36.978208 #4193427] DEBUG -- : node.rb: resolving node key 'password', with passed global value of '' and node value ''
D, [2023-07-19T13:44:36.978219 #4193427] DEBUG -- : node.rb: setting node key 'password' to value 'MyPassword' from global
D, [2023-07-19T13:44:36.978232 #4193427] DEBUG -- : node.rb: returning node key 'password' with value 'MyPassword'
I, [2023-07-19T13:44:36.978331 #4193427]  INFO -- : lib/oxidized/nodes.rb: Loaded 1 nodes
D, [2023-07-19T13:44:36.978373 #4193427] DEBUG -- : lib/oxidized/input/ssh.rb: Connecting to X.X.X.X
D, [2023-07-19T13:44:36.978424 #4193427] DEBUG -- : AUTH METHODS::["password"]
unable to connect
/var/lib/gems/3.0.0/gems/oxidized-script-0.6.0/lib/oxidized/script/script.rb:113:in `connect': unable to connect (Oxidized::Script::NoConnection)
	from /var/lib/gems/3.0.0/gems/oxidized-script-0.6.0/lib/oxidized/script/script.rb:92:in `initialize'
	from /var/lib/gems/3.0.0/gems/oxidized-script-0.6.0/lib/oxidized/script/cli.rb:122:in `new'
	from /var/lib/gems/3.0.0/gems/oxidized-script-0.6.0/lib/oxidized/script/cli.rb:122:in `connect'
	from /var/lib/gems/3.0.0/gems/oxidized-script-0.6.0/lib/oxidized/script/cli.rb:37:in `run'
	from /var/lib/gems/3.0.0/gems/oxidized-script-0.6.0/bin/oxs:5:in `<top (required)>'
	from /usr/local/bin/oxs:25:in `load'
	from /usr/local/bin/oxs:25:in `<main>'
oxidized@librenms:~$
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