Active IQ Unified Manager Discussions

PowerShell toolkit - Invoke-NcSSH private key file

Gab
4,443 Views

Hi everyone,

 

We have an issue with the Invoke-NcSSH command.

It was working very well for months and suddenly, last friday, the command failed and required to install putty.

 

After putty installation done, the command request now to add the remote key into Putty's cache :

PS C:\Users\user> Invoke-ncssh -name $user -command $command -PrivateKeyFile "C:\keys\itsoper\wfa.key" -username $user
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's xxx-sha2-nistp256 key fingerprint is:
xxx-sha2-nistp256 256 03:0d:3b:62:ae:6a:.........
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n)

We didn't find how to accept / ignore / bypass this output.

 

Any idea ?

4 REPLIES 4

Yanic
4,297 Views

Hi,

All my apologize if this question sounds stupid but... did you tried to press "y"  followed by enter ?
At this point, the cmdlet simply ask you if they key offered (by the remote host) should be trusted and added into the known_host file (locally).

Bests Regards,

mbeattie
4,266 Views

Hi,

 

Have you considered using "Invoke-NcSystemApi" (HTTPS) as an alternative to "Invoke-NcSsh"? (SSH)

Here is an example:

 

https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/NetApp-PowerShell-Toolkit-4-5P1-released/td-p/138566/page/2

 

/Matt

 

 

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

jfc916
4,169 Views

have you tried adding this to end of your command

 

-AcceptKey:$true

 

 

POLICARD
4,042 Views

Same issue today. Unable to simply reply "y", the keyboard is locked. Only a Ctrl+C allow to go back to the prompt ...

 

I had a look in registry HKCU\Software\SimonTatham\PuTTY\SshHostKeys and entry exists for shortname as I was able to add it using Putty ...

 

Then I realized all the other Key are using IP addresses instead of shortname used with Connect-NcController ... 😐

 

I have renamed the REG key and all is working fine

 

That means, if this issue is occuring, a workaround can be to use Putty to connect the controller using the IP address instead of the name and accept the key ...

Public