ytti / oxidized

Oxidized is a network device configuration backup tool. It's a RANCID replacement!
Apache License 2.0
2.76k stars 917 forks source link

ssh custom parameters #3265

Open Rico29 opened 1 week ago

Rico29 commented 1 week ago

Hello, I need to pass a custom parameter to ssh for connecting to old equipments, like

-o 'PubkeyAcceptedKeyTypes +ssh-rsa'

I'm quite new to oxidized and could not find the way to do that in rancid I used to do in .cloginrc

add sshcmd * {ssh\ -oPubkeyAcceptedKeyTypes=+ssh-rsa} Is there a way to do something equivalent with oxidized ? Regards

BenOoi commented 3 days ago

I have the exact same question. I am trying to connect to a Cisco C1000 running legacy IOS and this is needed. When I connect from inside the docker container I can connect with:

ssh -o KexAlgorithms=diffie-hellman-group14-sha1 -o HostKeyAlgorithms=ssh-rsa -o PubkeyAcceptedKeyTypes=ssh-rsa -i /home/oxidized/.ssh/id_rsa user@switch

I cannot find a way to add this to the config file.

skiera6 commented 2 days ago

I'm not directly associated with Oxidized, but based on my understanding:

From what I see in the Oxidized code Oxidized does not support custom ssh_options directly.

However, you can configure your "~/.ssh/config" to include settings like these:

Host switch
    HostName switch
    User user
    IdentityFile /home/oxidized/.ssh/id_rsa
    KexAlgorithms diffie-hellman-group14-sha1
    HostKeyAlgorithms ssh-rsa
    PubkeyAcceptedKeyTypes ssh-rsa

If you are running Oxidized inside a container, make sure the container has access to the SSH configuration and key files. This involves mounting the relevant SSH files into the container and ensuring proper permissions are set. After setting this up, it should work.

edit: Those options seem to be supported but i'm not sure about 'PubkeyAcceptedKeyTypes +ssh-rsa' use ssh_kex you can find some info here

ssh_keys: 
ssh_kex: 
ssh_encryption:
ssh_host_key: 
ssh_hmac:

Feel free to correct me