Permission denied (keyboard-interactive) error in powershell

29 Views Asked by At

using powershell posh-ssh , when i try this Approach A

$session = New-SSHSession -ComputerName $Server -Credential Get-Credential

i get this error

New-SSHSession: Permission denied (keyboard-interactive).

when i tried Approach B

$cred = Get-Credential

$session = New-SSHSession -ComputerName $Server -Credential $cred

it works!!!! but when i exit the session and open powershell session the error occurs when i try Approach B and it works when i try Approach A!!!!

i went to C:\OpenSSH-Win64\sshd_config_default i commented out PasswordAuthentication yes and restarted the service but still same, i made sure the sshd demon is running from C:\OpenSSH-Win64\sshd.exe

0

There are 0 best solutions below