InvalidOperation: (Renci.SshNet.SshClient:SshClient)
Hi, I've installed (by downloading .zip) and imported the Posh-ssh 2.2 module on Windows 2012 R2 machine.
I'm unable to establish an ssh session. I tried with different devices and of them throws the same error. The following error appears. I'm able to establish telnet to 22 port. The same code works fine on my PC (Windows 10).
PS D:> New-SSHSession -ComputerName "192.37.127.128" -Credential $creds -ErrorAction Stop -AcceptKey -ConnectionTimeout 10000 -Verbose
VERBOSE: Using SSH Username and Password authentication for connection.
Exception has been thrown by the target of an invocation.
At line:1 char:1
+ New-SSHSession -ComputerName "192.37.127.128" -Credential $creds -Err ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Renci.SshNet.SshClient:SshClient) [New-SSHSession], TargetInvocationException
+ FullyQualifiedErrorId : SSH.NewSshSession
Regards, Jakub
Not seen that error before. Did you unprotect the zip and changed execution policy? Also did you upgrade the version of PS on the server to 5?
On Apr 9, 2020, at 9:48 AM, Jakub Bielaszka [email protected] wrote:
Hi, I've installed (by downloading .zip) and imported the Posh-ssh 2.2 module on Windows 2012 R2 machine.
I'm unable to establish ssh session. I tried different devices and of them throws the same error. The following error appears. I'm able to establish telnet to 22 port.
PS D:> New-SSHSession -ComputerName "192.37.127.128" -Credential $creds -ErrorAction Stop -AcceptKey -ConnectionTimeout 10000 -Verbose
VERBOSE: Using SSH Username and Password authentication for connection. Exception has been thrown by the target of an invocation. At line:1 char:1
- New-SSHSession -ComputerName "192.37.127.128" -Credential $creds -Err ...
+ CategoryInfo : InvalidOperation: (Renci.SshNet.SshClient:SshClient) [New-SSHSession], TargetInvocationException + FullyQualifiedErrorId : SSH.NewSshSessionRegards, Jakub
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/darkoperator/Posh-SSH/issues/322, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD7IHQW6REHHT7OS2CBZALRLXG2FANCNFSM4MEXXOAA.
I'm using PS 5.1. This is my execution policy. I believe it's default. Yes, I unblocked (Unblock-File Posh-sh.zip) the file.
PS D:\> Get-ExecutionPolicy -List
Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process RemoteSigned
CurrentUser Undefined
LocalMachine Bypass