How can I generate new SSH keys?

The ssh-keygen command generates the authentication keys to use with ssh. It will generate both a public and a private key file, and place them in a subdirectory called ".ssh" in your home directory:

% ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (~user/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in ~user/.ssh/id_rsa.
Your public key has been saved in ~user/.ssh/
The key fingerprint is: