09-08-2023 05:15 AM
Good day, all. To date people here have been very helpful and believe me when I say that it is very much appreciated.
I am automating some simple tasks for controlling port access for certain users of our network. The commands that I am going to be sending are extremely simple using the Invoke-CiscoCommand Powershell script. It fits my needs perfectly.
Running SSH from a command prompt works. After the TCP connection is established, an SSHV2 packet is sent using the protocol SSH-2.0-OpenSSH_for_Windows_7.7 protocol.
Putty connects and works fine. After the TCP connection is established, an SSHV2 packet is sent using the SSH-2.0-PuTTY_Release_0.76 protocol.
On both of these, handshaking continues and encrypted traffic commences.
Where I am running into an issue is that the PoshSSH New-SSHSession will not connect to our CBS350 switch. After the TCP connection is established, an SSHV2 packet is sent referencing the SSH-2.0-Renci.SshNet.SshClient.0.0.1 protocol. The switch responds with a protocol reference SSH-2.0-OpenSSH_7.3p1.RL before an [ACK][FIN, ACK][ACK] and disconnect.
It seems to be more of a Posh-SSH issue but I figured that someone on here might be able to direct me to an SSH setting on the switch that might get over this hurdle.
Many thanks for reading.
09-08-2023 09:49 AM
Can you post full powershell script ( also use latest putty .78 have more ciphers to connect)
what more logs you on the switch ?
i used below script and tweaked for my needs on cat switches and works - never had chance with 350 SMB switches :
https://gist.github.com/JustinGrote/25ded39e7365515b8940c8c5e5febb19
09-08-2023 12:50 PM
There is no script involved. From the Powershell command line, the following command will not establish a connection. It tries but initiates the [ACK][FIN, ACK][ACK] sequence before disconnecting.
New-SSHSession -ComputerName $MyHostAddress -Credential (get-credential) -AcceptKey -ConnectionTimeout 90 -ErrorAction Stop
11-14-2023 12:13 PM
I'm dealing with the same thing. I have a script that connects to a bunch of switches and the connections succeed randomly, it definitely seems to be related to the .net library.
Has anyone figured this out yet?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide