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

Issues connecting when "Further authentication" is prompted

Open TheFlyingCorpse opened this issue 3 years ago • 1 comments

First, Thanks quite a lot btw, fantastic module! Its saving me quite a bit of lifting to wrap putty/scp in most cases.

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.

TheFlyingCorpse avatar Jan 26 '22 22:01 TheFlyingCorpse

Sadly it is not something supported by the library :(

Sent from my iPhone

On Jan 26, 2022, at 6:06 PM, Rune Darrud @.***> wrote:

 First, Thanks quite a lot btw, fantastic module! Its saving me quite a bit of lifting to wrap putty/scp in most cases.

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.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you are subscribed to this thread.

darkoperator avatar Jan 26 '22 22:01 darkoperator