0

Host machine ---- Jumpserver ( account password and then RSA Token password ) ---- SSH to cisco devices.

How do I create SSH sessions to end devices after SSH connection to jump host has been established using the below code. Also, if there is a better way to handle authentication with jumpserver that asks for auth password and RSA token as Link.

    import paramiko
    from paramiko import SSHException
    import logging
        
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    paramiko.common.logging.basicConfig(level=paramiko.common.DEBUG)
    
    ssh.connect(hostname="jump_server_ip", port=22)
    ssh.get_transport().auth_interactive_dumb(("username", "password"))

after pushing this command ssh.get_transport().auth_interactive_dumb(username="username") I get this Link.

Thank You

Thyrus
  • 458
  • 2
  • 13
  • For the purposes of testing, i was able to leverage keyboard-interactive for both Password: --- > This is the password for the username I give. Enter PASSCODE: --- > This is the RSA token that I need to supply This is just one time, so it can be keyboard-interactive, doesn't matter but once SSH to jumphost is established, there needs to be multiple SSH connections to hundreds of end hosts tunnel through this jumphost. I am not sure how do I go about achieving that. – Gurpreet Kochar Dec 02 '21 at 12:30
  • So basically, after pushing this command `ssh.get_transport().auth_interactive_dumb(username="username")` I get this [Link](https://imgur.com/CykeOEA) I need help with the next step of action.... How do i proceed from here to establish connections to end hosts. – Gurpreet Kochar Dec 02 '21 at 13:40
  • Thank you and sorry you had dig this out of me. Excuse the beginner in me trying to solve what is seemingly complicated for me. – Gurpreet Kochar Dec 02 '21 at 14:21
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/239785/discussion-between-gurpreet-kochar-and-martin-prikryl). – Gurpreet Kochar Dec 02 '21 at 17:03

0 Answers0