Network error: Permission denied when open a session.

Advertisement

Gérard
Guest

Network error: Permission denied when open a session.

Hi all,

I'm using provided example: https://winscp.net/eng/docs/library_session_getfiles#example
Code is compiled with .NET 4.8.1, and WinSCPnet.dll version 6.3.2.0.
Executed on a Windows Server 2022.

In SessionOptions I can use either password (ie: Password = "mypassword") or a private key (ie: SshPrivateKeyPath = "C:\\Temp\\mytestkey.ppk").

When try to connect and call session.Open(sessionOptions); I get this error:
Network error: Permission denied
Any idea what's the issue?

Thank you in advanced!

Best regards
Gérard

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: Network error: Permission denied when open a session.

Can you connect from the same machine using WinSCP GUI or any other SFTP client?
If you can, post its log file and equivalent log file from the .NET assembly.

Reply with quote

Gérard
Guest

Fixed

Hi,

For this particular error, "permission denied", unfortunately I didn't find any log in log file.
After some investigations I realized that I have to assign following parameters values in sessionOptions, they were not provided in the example I used:
sessionOptions.PortNumber
and sessionOptions.SshPrivateKeyPath when using an ssh key file
or sessionOptions.Password when using password directly

All works now.
Thank you!
Best regards
Gérard

Reply with quote

Advertisement

You can post new topics in this forum