After doing Import-Module SSH-Sessions, I try to connect as follows:
PS C:> New-SshSession -ComputerName 10.220.12.220 -Username username -Password ***********
Unable to connect to 10.220.12.220: Exception calling "Connect" with "0" argument(s): "No suitable authentication method found to complete authentication."
I can to it connect using putty. The putty log shows me this (hoe this helps):
2014-01-16 06:53:21 Looking up host "10.220.12.220"
2014-01-16 06:53:21 Connecting to 10.220.12.220 port 22
2014-01-16 06:53:21 Server version: SSH-2.0-OpenSSH_4.2
2014-01-16 06:53:21 Using SSH protocol version 2
2014-01-16 06:53:21 We claim version: SSH-2.0-PuTTY_Snapshot_2010_05_02:r8934
2014-01-16 06:53:21 Doing Diffie-Hellman group exchange
2014-01-16 06:53:21 Doing Diffie-Hellman key exchange with hash SHA-1
2014-01-16 06:53:23 Host key fingerprint is:
2014-01-16 06:53:23 ssh-rsa 2048 <some hex string>
2014-01-16 06:53:23 Initialised AES-256 CBC client->server encryption
2014-01-16 06:53:23 Initialised HMAC-SHA1 client->server MAC algorithm
2014-01-16 06:53:23 Initialised AES-256 CBC server->client encryption
2014-01-16 06:53:23 Initialised HMAC-SHA1 server->client MAC algorithm
2014-01-16 06:53:40 Access granted
2014-01-16 06:53:40 Opened channel for session
2014-01-16 06:53:40 Allocated pty (ospeed 38400bps, ispeed 38400bps)
2014-01-16 06:53:40 Started a shell/command
Comments: ** Comment from web user: drieseng **
The problem isn't in this library.
We do support password, public key and keyboard-interactive authentication.
It's just that the powershell module - which was not implemented by us - does not support keyboard-interactive authentication, and the SSH servers you're connecting to do not support the password authentication method.
That leaves you with a few options:
1. Use publickey authentication. For this you indeed need to first copy your public key to the authorized_keys file for the user account you're using to all your servers
2. Enable the password authentication method on all your servers.
3. Contact the author of the powershell module to support the keyboard-interactive authentication.
4. Do not use the powershell module, but use SSH.NET directly. This allows you to use keyboard-interactive authentication.
Hope this helps,
Gert