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

New-SFTPSession : Not able to connect for Password and Key authentication

Open VisheshTR opened this issue 4 years ago • 3 comments
trafficstars

Hello,

I am trying to create new SFTPSession = New-SFTPSession -ComputerName "Abc.com" -Credential Get-Credential -KeyFile $key -ConnectionTimeout 60 -AcceptKey Where authentication type is Password and Public Key but it seems like it not allowing to connect and getting error : New-SSHSession : Reached authentication attempt limit for method (publickey). I think the password here it is accepting is only for KeyPhrase password. Is there any alternate solution to create Session for Password and key Authentication?

VisheshTR avatar Nov 01 '21 20:11 VisheshTR

I have the same need. As almost of the University staff works from home, the infrastructure team decided to force to use a bastion (a unique server to connect ssh using JumpProxy option to go on the other server) and that one requires to use a key and a password to establish the connection. I have a lot of PowerShell scripts running on my computer that I can't use anymore because of th limitation. I think that the better solution is use a different parameter for the KeyPhrase instead of using the password of the credential and provide the password to the authentication process.

chrisptree avatar Sep 28 '22 20:09 chrisptree

Same here. I need to be able to use username, password, and private keyfile. I need password to not be the keyfile passphrase. :/ Guess I'll stick with WinSCP for now.

Szeraax avatar Mar 22 '23 00:03 Szeraax