Using the server certificate for authentication using client on Window 2008 server. Tried two different ways of connections
The reason for this is a feature called connection caching. As long as you have a connection open with one client (be it the graphical Terminal Client, command line sshg3 or sftpg3) your other clients can reuse that connection. This can be disabled in the configuration file to set exclusive connection for new connection under default settings or in the command line by using the --exclusive command line argument. This way you'll get more consistent results since it will always request a new connection on every attempt and should not get different results depending on whether other clients are running.
Now on to your questions:
Tectia client supports two types of server identification: plain hostkeys (Just signed keys really. This is the default and what OpenSSH also uses) and actual server certificates (the ones issued by Certificate Authorities, that is, full PKI). I suppose you're talking about server hostkeys here since this is the most common scenario, but please correct me if I'm wrong.
Now, if the server indeed seems to be sending different hostkeys every time this does sounds concerning. Are you connecting to multiple servers or just one? Are you sure it's not the same hostkey but just prompting to accept it again and again?
What do you answer to the prompt to save the hostkey (cancel/once/save) ? If answering once then the hostkey is only accepted for this one connection and the client will prompt again on the next connection.
If answering save it might be that the hostkey is not being saved for some reason. Check that the user has rights to write to the following location:
Sounds like the batch script may not be able to connect sometimes because the hostkey is not saved. And may work sometimes due to the connection caching.
answered Jan 18 '11 at 06:48
I am trying to run the same command in server through .net code. When I run it as a user it is working.But how do I give the option to save host key from .net when some other user is running for the first time. They should not be prompted to to save host key. I want to automate the code for any user to use it when they use my .net code.
answered Apr 20 '16 at 21:22