Flexion.Org
Bad grammar and typos for total strangers
Wiki › Copy Public Key
Wiki Index All Recent Edit Bottom

Copy the SSH public key

Now that you have keyfile(s) generated, or pre-existing, you need to append the contents of the .pub file(s) to the correct location on the remote server.

Assuming that you wish to login to the machine called "host1.example.org" from your current host with the id_rsa and id_rsa.pub files you've just generated you should run the following command:

 ssh-copy-id -i ~/.ssh/id_rsa.pub username@host1.example.org

This will prompt you for the login password for the host, then copy the keyfile for you, creating the correct directory and fixing the permissions as necessary.

The contents of the keyfile will be appended to the file '~/.ssh/authorised_keys'.

Complete the above for each keypair and the user account it is asscociated with. Once this has been done you should be able to login remotely. If you didn't enter a passphrase when creating the key pair and run commands without being prompted for a password. For example...

 ssh username@host1.example.org uname -a
 Linux host1.example.org 2.6.18-5-686 #1 SMP Mon Dec 24 16:41:07 UTC 2007 i686 GNU/Linux

$Id: CopyPublicKey,v 1.1 2008/04/14 09:42:36 martin Exp $

Wiki Index All Recent Edit Top
 
Valid XHTML Valid CSS Hacker