cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
525
Views
0
Helpful
3
Replies

SSH access to CBS350 works with CMD SSH and Putty but not Posh-SSH

bakerjw
Level 1
Level 1

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.

3 Replies 3

balaji.bandi
Hall of Fame
Hall of Fame

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

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

bakerjw
Level 1
Level 1

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

 

bpam
Level 1
Level 1

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?