Public key ssh login

From Biowikifarm Metawiki
Jump to: navigation, search

Setup on your local machine (Linux)

(TODO check if there is an more convenient and less complicate way)

Generate a public key (for the remote server) and a private key (only on your local machine) with comment within the key:

ssh-keygen -C 'firstname lastname <>'

Enter file in which to save the key (/home/myusername/.ssh/id_rsa): ‹provide NO file here!!›
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/myusername/.ssh/id_rsa.
Your public key has been saved in /home/myusername/.ssh/

Now in the hidden .ssh directory of your home directory exist 2 additional files: id_rsa (your private key) and id_rsa.pup (your public key)

Send only the public key ( to your server admin.

Now the ssh-agent must be running. There are different ways to accomplish this. According to Mark A. Hershberger's blog “Using ssh-agent with ssh” you can add the following lines to your profile file (in /home/yourusername/.profile or simply ~/.profile):

if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
  trap "kill $SSH_AGENT_PID" 0

Add the new keys by calling:


Now it should work. (done so on a local Linux OpenSuse 12.1 by --Andreas Plank 21:17, 11 February 2012 (CET))