Ad Widget

Collapse

Troubleshooting SSH agent items

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • troffasky
    Senior Member
    • Jul 2008
    • 567

    #1

    Troubleshooting SSH agent items

    I am trying to use an SSH agent item to log in to a Sonicwall firewall and fetch some data. I am struggling to even connect at all. According to a packet capture on the firewall, no connection is even attempted. Yes, I can ssh to the target from the proxy without issue.
    Key:
    ssh.run[snwlblob]
    note - no options actually set.
    Auth method: Password.
    User/pass are both usermacros.

    Error is: "Cannot set SSH session options: Invalid argument in ssh_options_set"

    Logs from proxy:

    27225:20250711:180435.892 In get_value() key:'ssh.run[snwlblob]'
    27225:20250711:180435.892 In ssh_run()
    27225:20250711:180435.892 End of ssh_run():NOTSUPPORTED
    27225:20250711:180435.892 Item [:ssh.run[snwlblob]] error: Cannot set SSH session options: Invalid argument in ssh_options_set

    AFAICT I have the only mandatory option set - the description. All others are optional. So why is it complaining?

    Why a proxy? Because I could not work out which subsystem to increase the debug level for in order to see what the server is doing. So I have spun up a proxy just for this!
  • troffasky
    Senior Member
    • Jul 2008
    • 567

    #2
    OK, looks like the previous error is actually only when using the "Test" button in the item configuration! If I use 'Execute now' instead, I get:

    27226:20250711:182556.824 In substitute_key_macros_impl() data:'ssh.run[snwlblob]'
    27226:20250711:182556.824 End of substitute_key_macros_impl():SUCCEED data:'ssh.run[snwlblob]'
    27226:20250711:182556.824 In get_value() key:'ssh.run[snwlblob]'
    27226:20250711:182556.824 In ssh_run()
    27226:20250711:182556.980 ssh_run() supported authentication methods: password
    27226:20250711:182556.988 ssh_run() password authentication succeeded
    27226:20250711:182558.053 End of ssh_run():NOTSUPPORTED
    27226:20250711:182558.053 Item [Sonic test SSH:ssh.run[snwlblob]] error: Cannot request a shell: Socket error: disconnected

    What does this mean? If I Google it, I come back to this thread from 2021:



    which seems to be the last time I was testing this. No progress in 4 years!

    Comment

    • troffasky
      Senior Member
      • Jul 2008
      • 567

      #3
      If I test with "normal" SSH client, it looks like it "requests a shell" and succeeds:

      [email protected]'s password:
      debug3: send packet: type 50
      debug2: we sent a password packet, wait for reply
      debug3: receive packet: type 52
      Authenticated to 10.10.10.10 ([10.10.10.10]:22) using "password".
      debug1: channel 0: new [client-session]
      debug3: ssh_session2_open: channel_new: 0
      debug2: channel 0: send open
      debug3: send packet: type 90
      debug1: Requesting [email protected]
      debug3: send packet: type 80
      debug1: Entering interactive session.
      debug1: pledge: filesystem
      debug3: receive packet: type 80
      debug1: client_input_global_request: rtype [email protected] want_reply 1
      debug3: send packet: type 82
      debug3: receive packet: type 91
      debug2: channel_input_open_confirmation: channel 0: callback start
      debug2: fd 3 setting TCP_NODELAY
      debug3: set_sock_tos: set socket 3 IP_TOS 0x10
      debug2: client_session2_setup: id 0
      debug2: channel 0: request pty-req confirm 1
      debug3: send packet: type 98
      debug1: channel 0: setting env LANG = "en_GB.UTF-8"
      debug2: channel 0: request env confirm 0
      debug3: send packet: type 98
      debug2: channel 0: request shell confirm 1
      debug3: send packet: type 98
      debug2: channel_input_open_confirmation: channel 0: callback done
      debug2: channel 0: open confirm rwindow 0 rmax 32768
      debug3: receive packet: type 99
      debug2: channel_input_status_confirm: type 99 id 0
      debug2: PTY allocation request accepted on channel 0
      debug2: channel 0: rcvd adjust 2097152
      debug3: receive packet: type 99
      debug2: channel_input_status_confirm: type 99 id 0
      debug2: shell request accepted on channel 0

      Comment

      Working...