Subscribe

Invoke-NaSsh not working anymore with DOT 8.2.5 7-mode

Hi all,

 

I upgraded one of our lab systems from ONTAP 8.2.4 to 8.2.5 (7-mode). Since that some of my scripts fail when doing "Invoke-NaSsh" against that system.

 

No idea why, I already regenerated SSH keys but error persists. It used to work with 8.2.4. And it's definitely not a credential issue.

 

PS C:\Users\mark> invoke-nassh -Name ucnlabfiler07 -Command date

invoke-nassh : An established connection was aborted by the software in your host machine.
In Zeile:1 Zeichen:1
+ invoke-nassh -Name ucnlabfiler07 -Command date
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidResult: (Smiley Happy [Invoke-NaSsh], SshConnectionException
    + FullyQualifiedErrorId : SshExecFailed,DataONTAP.PowerShell.SDK.Cmdlets.Toolkit.Ssh.InvokeNaSsh

 

Any ideas? Does ONTAP reject the client's key length? How can I make it work again?

 

Cheers,

Mark

Re: Invoke-NaSsh not working anymore with DOT 8.2.5 7-mode

How did you connect to the 7mode controller.  Invoke-nassh only supports via http/https, not rpc

Re: Invoke-NaSsh not working anymore with DOT 8.2.5 7-mode

I connect using credentials that were stored using Add-NaCredential before the ONTAP update. It worked before when ONTAP was 8.2.4.

 

PS C:\Users\mark> connect-nacontroller -name ucnlabfiler07 -HTTPS

Name                 Address           Ontapi   Version
----                 -------           ------   -------
ucnlabfiler07        10.230.1.7        1.21     NetApp Release 8.2.5 7-Mode: Wed Jul 19 03:55:53 PDT 2017


PS C:\Users\mark> invoke-nassh -Name ucnlabfiler07 -Command date
invoke-nassh : An established connection was aborted by the software in your host machine.
In Zeile:1 Zeichen:1
+ invoke-nassh -Name ucnlabfiler07 -Command date
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidResult: (Smiley Happy [Invoke-NaSsh], SshConnectionException
    + FullyQualifiedErrorId : SshExecFailed,DataONTAP.PowerShell.SDK.Cmdlets.Toolkit.Ssh.InvokeNaSsh

 

As you see the connection to ONTAPI works, but gets teared down when using SSH with the PSTK.

PuTTy works. OpenSSH clients work. Invoke-NaSSh does not longer work. But works with other systems including cDOT (or even third-party SSH servers), even when not connected to a NaController.

 

Toolkit version is 4.4.0. Can anyone check if invoke-nassh works with DOT 8.2.5?

 

Any hints? I suspect some new security related "feature" of ONTAP's sshd that blocks the connection request. Does anyone know what SSH client (wrapper) is embedded in the PSTK?

 

Re: Invoke-NaSsh not working anymore with DOT 8.2.5 7-mode

I think I found it. On 8.2.5 you have options for tls. Per default they are off. You have to enable tls.enable for connecting to the controller via https. Then invoke-nassh will work also. This is new in Ontap 8.2.5.

Re: Invoke-NaSsh not working anymore with DOT 8.2.5 7-mode

Unfortunately invoke-nassh is not working although I'm connected via https. Anybody an idea how to fix this?

Re: Invoke-NaSsh not working anymore with DOT 8.2.5 7-mode

Thanks for trying. Exactly same issue here. The problem is not with SSL (https), but with SSH itself.

 

I guess the PSTK includes "outdated SSH client" code (using old / weak host key or KEX algorithms with Invoke-NaSsh).

ONTAP 8.2.5 seems to just reject connections from this "client".

 

Strange thing is, the same call works agains ONTAP 9.1, so not wure if the culprit is within PSTK or ONTAP 8.2.5.

 

Ideas, anyone?

Re: Invoke-NaSsh not working anymore with DOT 8.2.5 7-mode

I also tried the newest toolkit on another w2k12R2 Server with powershell 5. Same issue. So I think it is Ontap 8.2.5. Without a solution for the issue we will have to stick with 8.2.4. Anybody an idea how this could be solved?

Re: Invoke-NaSsh not working anymore with DOT 8.2.5 7-mode

Hi Guys,

 

I noticed the same issue in my lab on an old 7-Mode simulator (Invoke-NsSsh failed).

The fix (in my environment) was  to re-run secureadmin (ensuring the key length is set to 2048):

 

TESTNS01> secureadmin setup -f ssl
Country Name (2 letter code) [US]: AU
State or Province Name (full name) [California]: NSW
Locality Name (city, town, etc.) [Santa Clara]: Sydney
Organization Name (company) [Your Company]: NetApp
Organization Unit Name (division):  NetApp
Common Name (fully qualified domain name) [TESTNS01.testlab.local]:
Administrator email:  admin@testlab.local
Days until expires [5475] :3650
Key length (bits) [512] :2048
Tue Sep  5 10:20:38 AEST [TESTNS01:secureadmin.ssl.setup.success:info]: Restarting SSL with new certificate.

PS C:\> Invoke-NaSsh -Name testns01.testlab.local -Command version -Credential $credential
NetApp Release 8.2.3 7-Mode: Thu Jan 15 21:30:45 PST 2015

/Matt

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: Invoke-NaSsh not working anymore with DOT 8.2.5 7-mode

Hi Matt,

 

thanks for your reply, but this question is specific for ONTAP 8.2.5 - I'm aware about the certificate/key length issues.

 

8.2.5 is a security/maintenance release for 7-mode and obviously something has changed that breaks the PSTK cmdlet (and thereby my scripts...).

 

Could anyone from the PSTK devs give us feedback here please?

 

Mark

 

Re: Invoke-NaSsh not working anymore with DOT 8.2.5 7-mode

We did a pktt to compare ssh access between 8.2.4 and 8.2.5:

works -> 8.2.4:

"Server: Protocol (SSH-2.0-Data ONTAP SSH 1.0)"
"Client: Protocol (SSH-2.0-Renci.SshNet.SshClient.0.0.1)"

Doesn't work -> 8.2.5:

"Server: Protocol (SSH-2.0-OpenSSH_7.2 FreeBSD-20160310)"
"Client: Protocol (SSH-2.0-Renci.SshNet.SshClient.0.0.1)"

Putty to 8.2.5:

"Server: Protocol (SSH-2.0-OpenSSH_7.2 FreeBSD-20160310)"
"Client: Protocol (SSH-2.0-PuTTY_Release_0.63)"

So ssh server changed in 8.2.5 and the ssh client in the toolkit seems not to be supported anymore.