Search code examples
windowspowershellsshpowershell-2.0sudo

Use sudo with SSH-Session from PowerShell


On my Windows computer I use SSH-Session module on PowerShell and I want to use sudo in order to execute special command in my server.

But when I launch my sudo command through SSH-Session I have this error:

sudo: no tty present and no askpass program specified

I don't want to use PuTTY or the ssh command, so the parameter -l is not the issue!

If it's possible I don't want to change the SSH server configuration.

I want to know how to force the pseudo allocation tty in PowerShell?

Thanks


Solution

  • You can now use the Open SSH exe, push by Microsoft here.

    After launch PowerShell as administrator

    ssh 192.168.1.123 -p 22 -l general03