EvotecIT / Transferetto

Small PowerShell module with FTPS/SFTP functionality
MIT License
55 stars 14 forks source link

Connect-SFTP with Azure #26

Closed nulfly closed 7 months ago

nulfly commented 1 year ago

Not sure if this is a bug, my own error, or something not supported.

I have an Azure storage account with SFTP enabled. I can connect to it using a WinSCP client, or even the WinSCP powershell module.

I have not been able to utilize Connect-SFTP using the same information. I've even went as far as connecting all three ways that are offered. Also confirmed each method worked in a client.

WARNING: Connect-SFTP - Error: Exception calling "Connect" with "0" argument(s):
"The connection was closed by the server:  - RequestId:SCRUBBED Time:SCRUBBED (KeyExchangeFailed)."
$dstClient = @{
    HostName = "scrubbed.blob.core.windows.net"
    UserName = "scrubbed.user"
    Password = "scrubbed.pass"
    Path = "/"
}

$dUser=$dstClient.UserName
$dPass=$dstClient.Password
$dHost=$dstClient.HostName

$sshkey = "F:\scrubbed\p.key"

#Create Destination Credentials
$dstPass = ConvertTo-SecureString $dPass -AsPlainText -Force
$dCred = New-Object System.Management.Automation.PSCredential ($dUser, $dstPass)

## Each method listed but I would only execute with one of them uncommented.
#Key Method
$dstServer = Connect-SFTP -Server $dHost -Verbose -Username $dUser -PrivateKey $sshkey
#User Pass Method
$dstServer = Connect-SFTP -Server $dHost -Verbose -Username $dUser -Password $dPass
#PS Credential Method
$dstServer = Connect-SFTP -Server $dHost -Verbose -Credential $dCred

I do have this working with my other SFTP source that is not hosted in Azure.

My goal was to use Start-FXPFileTransfer to see if I could transfer between two SFTP for my project and then provide the source for reference to the git since no examples exist.

If I could provide anything else, I am more than happy too.

Have a great day or evening!

ZillaG commented 1 year ago

I get this error too when connecting to an SFTP server.

WARNING: Connect-SFTP - Error: Exception calling "Connect" with "0" argument(s):
PrzemyslawKlys commented 9 months ago

IS this still an issue?

PrzemyslawKlys commented 7 months ago

You would need to provide more details?

Kellett commented 7 months ago

Sorry, mine was user error. I've deleted my comment