Posh-SSH icon indicating copy to clipboard operation
Posh-SSH copied to clipboard

New-SSHSession "A connection attempt failed ..."

Open OrKarstoft opened this issue 6 years ago • 2 comments
trafficstars

Hello,

I've been experienced some issues with using the command New-SSHSession to connect to hosts in the other side of the world. Pings to the host are 160-180ms which confirms longer connection time.

Using the following command gives the following error; New-SSHSession -ComputerName ### -Port 22 -AcceptKey:$true

New-SSHSession : Connection failed to establish within 10000 milliseconds.
At line:1 char:1
+ New-SSHSession -ComputerName ### -Port 22 -AcceptKey:$true
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationTimeout: (Renci.SshNet.SshClient:SshClient) [New-SSHSession], SshOperationTimeoutException
    + FullyQualifiedErrorId : SSH.NewSshSession

Using following command gives the following error; New-SSHSession -ComputerName ### -Port 22 -AcceptKey:$true -ConnectionTimeout 100 -KeepAliveInterval 100 -OperationTimeout 100

New-SSHSession : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has fa
iled to respond
At line:1 char:1
+ New-SSHSession -ComputerName ### -Port 22 -AcceptKey:$true -Connection ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Renci.SshNet.SshClient:SshClient) [New-SSHSession], SocketException
    + FullyQualifiedErrorId : SSH.NewSshSession

(Credential parameter removed for testing purposes)

Testet with PuTTY, working fine.

Any idea what is causing this?

$PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
4      0      -1     -1     

OrKarstoft avatar Jun 25 '19 07:06 OrKarstoft

I would say check the logs on the linux host and do a PCAP to see if it shoes any response not shown.

Sent from my iPhone

On Jun 25, 2019, at 3:58 AM, Oliver Karstoft [email protected] wrote:

Hello,

I've been experienced some issues with using the command New-SSHSession to connect to hosts in the other side of the world. Pings to the host are 160-180ms which confirms longer connection time.

Using the following command gives the following error; New-SSHSession -ComputerName 192.169.66.87 -Port 22 -AcceptKey:$true

New-SSHSession : Connection failed to establish within 10000 milliseconds. At line:1 char:1

  • New-SSHSession -ComputerName 192.169.66.87 -Port 22 -AcceptKey:$true
  •   + CategoryInfo          : OperationTimeout: (Renci.SshNet.SshClient:SshClient) [New-SSHSession], SshOperationTimeoutException
      + FullyQualifiedErrorId : SSH.NewSshSession
    

Using following command gives the following error; New-SSHSession -ComputerName ### -Port 22 -AcceptKey:$true -ConnectionTimeout 100 -KeepAliveInterval 100 -OperationTimeout 100

New-SSHSession : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has fa iled to respond At line:1 char:1

  • New-SSHSession -ComputerName ### -Port 22 -AcceptKey:$true -Connection ...
  •   + CategoryInfo          : InvalidOperation: (Renci.SshNet.SshClient:SshClient) [New-SSHSession], SocketException
      + FullyQualifiedErrorId : SSH.NewSshSession
    

(Credential parameter removed for testing purposes)

Testet with PuTTY, working fine.

Any idea what is causing this?

$PSVersionTable.PSVersion

Major Minor Build Revision


4 0 -1 -1
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

darkoperator avatar Jun 25 '19 13:06 darkoperator

update: i could ssh to target server. have to use FQDN instead of IP and it works well. thanks all for your advices.

dunglerpa avatar Nov 09 '21 03:11 dunglerpa