Some progress: This is working for the cyg_server user. That is the user by which the sshd is service is running. But this is not working other users.
Some more progress: This is working for any account on which the services is started with. That is if we give credentials of a particular account in Log On tab of a service. Then it works for that account and so on.
Original Question:
cmdkey is a command used to display windows credential manager keys.
So I installed Cygwin sshd server in my local Windows. Booted into a Ubuntu vm and tried to ssh to my windows. This worked. When I run cmdkey command directly in my local this displays a set of credential manager keys. But when I'm running the same command from ssh login, this is giving an empty output.
I also observed any programs saving keys to windows credential manager are giving me A specified logon session does not exist. It may already have been terminated
error. (Only when running via ssh)
Although there are some pointers towards the issue on the internet. I was not able to exactly find the root issue.
Edit: Additional Information
The program that I wrote is ultimately calling CredWriteW function from win api.
Could you help?
Disclosure: I asked this in superuser.com as well.