Code:
var connectionInfo = new ConnectionInfo(Utilities.GetConfigValueByKey(processName + Constants.KEY_FTP_SERVER), Convert.ToInt32(Utilities.GetConfigValueByKey(processName + Constants.KEY_FTP_PORT)),
Utilities.GetConfigValueByKey(processName + Constants.KEY_FTP_USERID),
new PasswordAuthenticationMethod(Utilities.GetConfigValueByKey(processName + Constants.KEY_FTP_USERID)
, Utilities.GetConfigValueByKey(processName + Constants.KEY_FTP_PWD)),
new PrivateKeyAuthenticationMethod(Utilities.GetConfigValueByKey(processName + Constants.KEY_FTP_USERID),
new PrivateKeyFile(File.OpenRead(@"C:\Jobs\Test\id_rsa"), "testpwd"))
);
It fails at the privateKeyfile, can someone help me what is that I am doing wrong.
I have tried the filename as a text file but still no luck.
For the history and if could help someone. The issue for me was with the passphrase. Had an extra character (carriage return) and it makes brake the key access and show this error
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With