Issues connecting when "Further authentication" is prompted
See original GitHub issueReferencing darkoperator/posh-ssh#443
The author of said project has responded saying SSH.NET does not support further authentication prompts. The server in question requires both a username+key, followed by a prompt for an OTP code.
When using said project: Using PoSH-SSH 3.0.0 does not work for me when the server is setup to accept keys, with a prompt during auth for OTP. Example: auth using “user” with key (empty pass), in PuTTy its seen as:
login as: user
Authenticating with public key "rsa-key...." from agent
Further authentication required
Keyboard-interactive authentication prompts from server:
| OTP Code:
This is how I try to connect, it fails with “New-SSHSession : No suitable method found to complete authentication (keyboard-interactive)”
$key = C:\temp\test.key
$IP = "10.10.10.10"
$cred = Get-Credential
New-SSHSession -Computername $IP -KeyFile $key -Credential $cred
Any thoughts on how I can pass the OTP code for a proper auth? I have the OTP token as a variable. I’ve also tried to set it as the password for the $cred, to no avail.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8

Top Related StackOverflow Question
Will have to see how I will implement this and not break the curren command parameters and add an option like that, it will require for me to change the parameter sets of the functions, I use user /cred for key so adding keyboard interactive will mean an additional parameter for the OTP code only for one user out of o er 2 million downloads, so will need to plan it out and see how I can test without adding breaking changes.
Had issues with some users with weird banners where the password was entered before the banner finished showing that is why I do the check.