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 custom parameters #3265

Open
Rico29 opened this issue Sep 12, 2024 · 5 comments
Open

ssh custom parameters #3265

Rico29 opened this issue Sep 12, 2024 · 5 comments

Comments

@Rico29
Copy link

Rico29 commented Sep 12, 2024

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
Copy link

BenOoi commented Sep 18, 2024

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
Copy link

skiera6 commented Sep 19, 2024

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

@systeembeheerder
Copy link
Contributor

snippet from my config file:

models:
  vrp:
    vars:
      ssh_kex: "diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1"
      ssh_keys: "~/.ssh/id_ecdsa"
#  procurve:
#    vars:
#      ssh_kex: "diffie-hellman-group14-sha1"
  fortios:
    vars:
      remove_secret: true
  aosw:
    vars:
      remove_secret: true
  ciscosmb:
    vars:
      ssh_kex: "diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1"
input:
  default: ssh
  debug: false
  ssh:
    secure: false

@Rico29
Copy link
Author

Rico29 commented Sep 30, 2024

nice ! thanks ! is theree any doc about that ?

@systeembeheerder
Copy link
Contributor

@skiera6 already pointed to the documentation for the ssh options. I just use groups to apply them to all devices of the same model. The exact key names can be found in the ssh_config man pages

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

4 participants