-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Description
Issue Description
I'm trying to open session with generated SSH key, but when open session module is trying to connect as anonymous user. How can I defined name of the user I want to be logged to? addinf Credential option will pop out password prompt...
Example
$sessionOptions = New-WinSCPSessionOption -HostName $Hostname -Protocol sftp -SshHostKeyFingerprint $SshHostKeyFingerprint -SshPrivateKeyPath $SshPrivateKeyPath -SecurePrivateKeyPassphrase $SecurePrivateKeyPassphrase
Expected Output
Connection should be established via SSH key on defined user.
Actual Output
New-WinSCPSession : Exception calling "Open" with "1" argument(s): "Connection has been unexpectedly closed. Server sent command exit status 0.
Authentication log (see session log for details):
Using username "anonymous".
Server refused our key.
Authentication failed."
At line:1 char:25
+ ... $session = New-WinSCPSession -SessionOption $sessionOptions
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-WinSCPSession], MethodInvocationException
+ FullyQualifiedErrorId : SessionRemoteException,New-WinSCPSession
WinSCP-PowerShell Version
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 0.0.0.0 WinSCP {ConvertTo-WinSCPEscapedString, Copy-WinSCPItem, Get-WinSCPChildItem, Get-WinSCPHostKeyFingerprint...}
Environment
FTP:
SUSE Linux Enterprise Server 12 SP3
Metadata
Metadata
Assignees
Labels
No labels