-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problems with private key authentication #62
Comments
Thank you for your interest in the LIBSSH2 for LabVIEW toolkit, and for the detailed debugging information. I am sorry you are experiencing issues with the toolkit and public-private authentication.
Did you use the I am looking at my I know there is a bug between libssh2 and LabVIEW with using the public-private key file API. You cannot simply pass a path to the key files like the command line. Instead, the public-private keys must be explicitly read using the LabVIEW File APIs into strings and then the libssh2 "memory" public-private key API can be used. The "Public Key File" instance of the Authenticate.vi actually implements this workaround for you. Can you share more of the LabVIEW code, possibly as a VI Snippet? Can you try the Public Key File Authentication example? This implements the LabVIEW File IO to libssh2 memory workaround. Did you add a passphrase to the public-private key and are using a ssh-agent on the command line? It is interesting everything appears to work from the command line with the cRIO communicating to the server. This is a good indicator the server and client are compatible and most likely something with using this library. |
Thanks for your response and for looking into it a bit deeper for me! Ah.... good point, I'm not using a ssh-agent. In my tests from a terminal from the cRIO, to test a ssh connection out (which I have successfully done), I'm using the command No, I did not use the ssh-copy-id utility (because the cRIO doesn't have it natively), but I copied the keyfiles across to a different computer, and did it from there (after removing the I added a I used both I am passing in an empty string as the password into the authenticate.vi. I have attached a snippet of code I'm using. I've got all the options there for each method in there so you can see my methodology (I was using those with testing, and just unwiring/rewiring the method I wanted to test/use. Not the most elegant, but worked in a pinch). |
It is possible the public-private key pair that was created using the CLI is not supported by the version of libssh2 used by this toolkit. You generated the public-private key on the cRIO or did you generate from another computer and then copy over to the cRIO and the remote server? Can you provide the version of the SSH client on your cRIO and the version of the SSH server on the remote host? You used the
The default type, |
I'm trying to get public/private key authentication working with this library. Not sure if this is an issue, or likely an issue with the user (me).
I can successfully get it working with username/password combination, however having issues with private key.
I have a server which has the public key saved in its authorized_keys file, and I can ssh successfully from the cRIO to the server using this keyfile from the a command prompt on the cRIO (i.e. ssh -i privateKeyName user@serverIP).
However when I use the public key data, or public key file methods in this library, I get an authentication error.
I generated the public/private key pair just using:
and then I put the public key info into the authorised_keys file on the test server.
are the files generated by ssh-keygen the correct format that this library is expecting?
The format for each key file is the following:
I'm only using this for testing, so I'm not that concerned about teh secrecy of the content of these files, but here's what the contents of my keyfiles are the following:
Private key:
public key:
Any direction or help is appreciated. Let me know if you need any more information. thanks.
The text was updated successfully, but these errors were encountered: