(None of this answer is Mac OSX specific, but is how BSD/Unix works. Since Mac OSX/Darwin is based on BSD/Unix, this is expected to apply and work fine for you, and would also apply to other Unixes.)
Yeah... the results you report are exactly what are expected.
Here's what happened: You ran "sudo". The "sudo" command tried to run "cd ~/.ssh", which probably failed because "cd" is an internal command. To make that command work, which won't accomplish what you are trying to do, you could use:
sudo -c ${SHELL} "cd ~/.ssh"
Then, the sudo command exits, and so you're back in your current directory, giving you the unwanted results you're getting.
You should have access to your own home directory, so your solution is to just drop the word "sudo", which helps you with permissions. If you were trying to get to another user's directory, you would probably want to create a sub-shell, so you would use:
sudo -c ${SHELL} "cd ~anotherUser/.ssh"
Then, your prompt will likely change to have a # instead of a $, since sudo gave you superuser privileges. When you're done doing your "rootly" things, type "exit" to change your prompt back to being unprivileged, showing a $ instead of a #.