You can generate a key in Linux using the ssh-keygen command.
You can run it in command line. You will be asked for a file in which the key should be saved to and for a passphrase (password) for the key:
This command will generate id_rsa public and private keys.
If you need to generate id_dsa keys then you need to run ssh-keygen -t dsa