Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: Timeout establishing SSH sessions

$
0
0
Hi Jim

The code is very simple, I can connect using ssh but when I execute a command I get the following error:-

Enter-SshSession : Exception calling "RunCommand" with "1" argument(s): "Session operation has timed out"

Code below:-

New-SshSession -ComputerName <myipaddress> -Username 'myservername\username' -Password 'mypassword' -port 22
Enter-SshSession -ComputerName <myipaddress>

try{
$results = Invoke-SshCommand -Command 'mkdir c:\test' -ComputerName <myipaddress>
}
catch {
Write-host $($Error[0].Exception.Message)
}
finally
{
Remove-SshSession -RemoveAll
Get-SshSession
}
$results = Invoke-SshCommand -Command

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>