Monday, February 25, 2013

Setup SSH Private-Public Keys on Unix

  1. Generate Key-Pair using PuTTYGen
  2. Save private key to a safe place.  
  3. Massage the public key into openSSH format by doing the following
    •     Remove lirst 2 line
    •     Remove last line
    •     Join all lines into a single line
    •     Add 'ssh-rsa ' (remember the trailing space) at the start of the line


  4. Copy public key to unix ~/.ssh/authorized_keys file or append to the existing file content
  5. Use PuTTY to select the private key to ssh to the remote server

NOTE

If using Java library such as JSch to connect using private key, need to export private key into openSSH format first.  Load the private key just created into PuTTYGen and select convertion -> Export Openssh Key option.  Use the openssh format private key in Java code to connect to ssh.


6 comments :

  1. You have touched good quality points here. In whatever way continue writing.
    Addiction treatment Tennessee

    ReplyDelete
  2. You have really selected the suitable topic; this is one of my favorite blogs.Rehab Georgia

    ReplyDelete
  3. I’m trampled by your contents carry on the wonderful work.
    Georgia addiction treatment

    ReplyDelete
  4. Whatever you have provided for us in these posts really appreciative.
    Treatment center Georgia

    ReplyDelete
  5. Do you actually need a hosting to write a blog? It depends but it is advisable to have own hosting if you are serious about your blog. Here is a guide on what consideration points you should take. https://onohosting.com/

    ReplyDelete
  6. Starting now and into the foreseeable future we will examine a portion of the more unmistakable manners by which Linux deferrers from Windows.
    https://onohosting.com/

    ReplyDelete