For an RSA key:
ssh-keygen -t rsa
or for a DSA (Digital Signing Algorithm) key:
ssh-keygen -t dsa
NOTE: When asked for a pass phrase leave blank unless absolutely required,
This will create two files: id_dsa and id_dsa.pub. The pub file is the public key and will be placed on the remote server.