A public and private key pair with no passphrase will be automaticly created when you login to Shark and there is no .ssh directory. If your SSH key pair does not work any more just delete your .ssh directory, log out and back in again, then the SSH key pair will be created again.
Configuring public key authentication
Without any configuration, connecting to any worker node from the head node (e.g., qlogin) will require password authentication. It is more convenient to use public key authentication, especially if you're using qmake.
To create a private/public key pair your self, type (on the head node):
ssh-keygen -t rsa -C "firstname.lastname@example.org on shark"
You'll be asked for a passphrase (twice), which you probably want to leave empty (just press enter).
Note: It is usually good practice to use a passphrase. However, on Shark this is quite inconvenient.