Username not Working with Session Options when SSH Private Key Auth Utilized

Advertisement

testval123
Joined:
Posts:
1

Username not Working with Session Options when SSH Private Key Auth Utilized

Hello,

If I use username/password combination, the script opens with Username as expected, ie. open sftp://user:**@sftp.blah.com:22

However, if I specify SshPrivateKeyPath, it does NOT utilize the username and instead attempts to prompt for it, even if the username is specified in the SessionOptions properties.

Ie. open sftp://blah.com:22
...
Username:   (Password: NO, Key file: Yes, Passphrase: Yes)
..
Reading key file"blah.ppk"
Prompt (username, "SSH login name", <no instructions>, "login as:" 
Prompting user for credentials.
Prompt cancelled.
User aborted at username prompt
Attempt to close connection due to fatal exception:
**Credentials were not specified**
Why does the username/password work, and not the SSH Key?

Reply with quote

Advertisement

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

Re: Username not Working with Session Options when SSH Private Key Auth Utilized

Please post your code and corresponding session log file (Session.SessionLogPath).

Reply with quote

Advertisement

You can post new topics in this forum