The public key gets added to the authorized_keys file of the server. The client (at home) has both in /home/myuser/.ssh/. You don't need to be root to generate a key pair. What user will you be logging into the server as? It is better to log into a server as a regular user and use sudo instead of allowing root logins. If you must use root (e.g. only user on server) make sure that you use a very good passphrase. This will protect your private key if stolen or copied. Especially important for laptops which are often lost or stolen in airports and coffee shops.
If this is your home clients key pair, then having id_rsa and id_rsa.pub in ~/.ssh/ will work fine. If you already have a key pair, consider changing the names and using the "-i <identify file>" option of ssh so the correct key is used.
ssh myuser@host -i ~/.ssh/myuser_id_rsa
The permissions of ~/.ssh and id_rsa is important. Don't allow "other" read access. Also don't allow "other" read or execute access to your home directory.
some caveats. In the server's /etc/ssh/sshd_config file, if "AllowUsers" is used (a good idea) make sure the username is listed. For the latest openSuSE, the AuthorizedKeys entry needs "%h" in it: "AuthorizedKeysFile %h/.ssh/authorized_keys". Might just be true for openSuSE. Found it after upgrading and reading distro release notes. If converting from password authentication to using a key, log in using a password and leave it open. Test pubkey authentication in a new console, just in case there is a problem loggin in. You can undo changes in the first terminal. Remember that if changes to the server's /etc/ssh/sshd_config are needed, that the ssh service needs to be restarted. E.G. if adding user to "AllowUsers".
Last edited by jschiwal; 02-17-2011 at 10:50 PM.