1
votes

I have windows remoting enabled on my dev machine, using FreeSSHd and PuTTY as a SFTP server and client. I am using public authentication only, having the private key loaded in PuTTY's Pageant.

I use Windows Powershell Remoting to perform a call to PuTTY's PSFTP command line tool (having the binary folder of PuTTY in the PATH environment system variable), using C# code (using the Powershell automation assembly & namespace).

If I open Windows Powershell and perform this call: invoke-command -computername 127.0.0.1 -filepath c:\temp\sftp\invoke.ps1

I get an error:

Fatal: Disconnected: No supported authentication methods available (server sent: publickey)

When checking FreeSSHd's log I see only this:

  • 12-06-2011 14:12:04 IP 127.0.0.1 SSH connection attempt.
  • 12-06-2011 14:12:04 IP 127.0.0.1 SSH disconnected.
1

1 Answers

1
votes

(workaround)

It seems to be an issue with the combination of a remote powershell session (the Powershell pipeline) and the command being invoked within that session. I was using PageAnt to get the decrypted signature from the private key, but looking at the log, it seems that PSFTP cannot 'see' PageAnt, which causes the authentication to fail.

I resolved this (not very recommendable regarding security, but this is all within a secure/non-internet environment): I used the PSFTP -i option to reveal the private key location, and the -pw option to provide the password. Then the call succeeds.

Hopefully there is better way doing this...