[solved ]Oxidized ssh to juniper issue

Hello!
I try to run oxidized (0.27.0) on Ubuntu 18.04.3 LTS. Install it according to the official manual (GitHub - ytti/oxidized: Oxidized is a network device configuration backup tool. It's a RANCID replacement!). And configure to backup config from juniper MX via ssh-key. Generate key-pair, create a user on Juniper, add pub key to Juniper. Check ssh login under oxidized user to the device and all works fine.
Modify the oxidized config file:


username: diffs
model: junos
resolve_dns: true
interval: 3600
use_syslog: false
debug: true
threads: 30
timeout: 20
retries: 3
prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
next_adds_job: false
rest: false
vars:
remove_secret: true
auth_methods: “publickey”
ssh_keys: “/etc/oxidized/.ssh/id_rsa”
groups: {}
models: {}
pid: “/etc/oxidized/pid”
crash:
directory: “/etc/oxidized/crashes”
hostnames: false
stats:
history_size: 10
input:
default: ssh
debug: true
ssh:
secure: false
utf8_encoded: true
source:
default: csv
csv:
file: ~/router.db
delimiter: !ruby/regexp /:confused:
map:
name: 0
model: 1
username: 2
ip: 3
vars_map:
enable: 4
model_map:
juniper: junos
mellanox: mlnxos
cisco: ios

Add “router.db” file and run oxidized and get error on ssh connection:
INFO – : lib/oxidized/nodes.rb: Loaded 1 nodes
DEBUG – : lib/oxidized/core.rb: Starting the worker…
DEBUG – : lib/oxidized/worker.rb: Jobs running: 0 of 1 - ended: 0 of 1
DEBUG – : lib/oxidized/worker.rb: Added /gw1 to the job queue
DEBUG – : lib/oxidized/worker.rb: 1 jobs running in parallel
DEBUG – : lib/oxidized/job.rb: Starting fetching process for gw1 at 2019-11-25 18:45:03 UTC
DEBUG – : lib/oxidized/input/ssh.rb: Connecting to gw1
DEBUG – : AUTH METHODS::publickey
DEBUG – net.ssh.transport.session[2b1f13b9dae0]: establishing connection to 10.10.100.1:22
525014 #17814] DEBUG – net.ssh.transport.session[2b1f13b9dae0]: connection established
INFO – net.ssh.transport.server_version[2b1f13b9c53c]: negotiating protocol version
DEBUG – net.ssh.transport.server_version[2b1f13b9c53c]: local is SSH-2.0-Ruby/Net::SSH_5.2.0 x86_64-linux-gnu' DEBUG -- net.ssh.transport.server_version[2b1f13b9c53c]: remote is SSH-2.0-OpenSSH_6.9’
INFO – net.ssh.transport.algorithms[2b1f13b9302c]: sending KEXINIT
DEBUG – socket[2b1f13b9d5f4]: queueing packet nr 0 type 20 len 1324
DEBUG – socket[2b1f13b9d5f4]: sent 1328 bytes
DEBUG – socket[2b1f13b9d5f4]: read 1448 bytes
DEBUG – socket[2b1f13b9d5f4]: read 200 bytes
DEBUG – socket[2b1f13b9d5f4]: received packet nr 0 type 20 len 1644
INFO – net.ssh.transport.algorithms[2b1f13b9302c]: got KEXINIT from server
INFO – net.ssh.transport.algorithms[2b1f13b9302c]: negotiating algorithms
DEBUG – net.ssh.transport.algorithms[2b1f13b9302c]: negotiated:

  • kex: ecdh-sha2-nistp521
  • host_key: ecdsa-sha2-nistp256
  • 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:
    DEBUG – net.ssh.transport.algorithms[2b1f13b9dc20]: exchanging keys
    DEBUG – net.ssh.authentication.session[2b1f13d21d58]: beginning authentication of diffs' ERROR -- : 10.10.100.1 raised NoMethodError with msg "undefined method each’ for “publickey”:String", 10.10.100.1 saved
    DEBUG – : lib/oxidized/node.rb: Oxidized::SSH failed for gw1
    DEBUG – : lib/oxidized/job.rb: Config fetched for gw1 at 2019-11-25 18:45:06 UTC
    WARN – : /gw1 status no_connection, retries exhausted, giving up

How I can fix this issue?

Thanks!

Change this line to
auth_methods: [ “none”, “publickey”, “password”, “keyboard-interactive” ]

Solve problem!

@Yuriy_Borysov this config works for me, and then I didnt have to add auth_methods (but I’m not sure it defaults to pubkey)

groups:
  juniper:
    username: oxidized
    vars:
      ssh_keys: "~/.ssh/id_rsa"