I have a .ppk file which contain public key and private key, I want to make a connection to the remote database ssh( in my java program) , but I don't know, for this connection, I have to use public key as password or private key?
Finally, I found my answer, for my connection , firstly I made a public and private key for the server(server A) that has my java code, with this command
ssh-keygen -t rsa
this command generate public and private key. and then I put my public key in the server which has my database(server B), in the .ssh folder (/home/user/.ssh)
so I connected to the database with the ssh
>ssh username@ip
and finally I put my private key in my java-code which helped me to connect to the database server(server B) from code-server(server A)
this links is helpful:
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments