Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SSH Public Key Authentication

 
Dawn Thomas
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was asked to integrate SSH public key authentication to my code (to avoid using passwords when logging into a server). I have searched the web but I'm not sure if I have the terms wrong - I'm not finding any examples. Does anyone know where I can look or can someone recommend a book?

Thanks.
 
Sivaraman Lakshmanan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dawn,
For SSH public key authentication you can use JSCH API. Refer to this site where you can get the jar file as well as good examples.

Hope this help
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of communication are you trying to enable? SSH is used to open a terminal connection to a remote machine (like Telnet, only more secure). As such, it's rarely used in an application - you'd use the SSH client from the command line. Sometimes it's used to enable secure FTP transfers, though (and then it's called SFTP). So ... what exactly does this code do?
 
Dawn Thomas
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.

I need the code for 2 things:
1. to FTP a file from one location to another and
2. to login to the server and verify that a file exists in a specific location.

We do this right now using a username and password but these change quite often and it would be easier to use a token or key to login instead of a password.

I'll peruse the link you sent and see if it meets my needs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic