First off it's the private key that will have the pass-phrase. This validates against the public key stored on the remote server.
Best guess is that your are trying to use a putty private key (ppk
) key format with openssh this doesn't work.... PuTTYgen has an export option for openssh if this is the case.
ssh-rsa AAAAB3NzaC1y...... etc
I also assume that the server you are trying to ssh to has your public key stored correctly in the authorized key file (in ~/.ssh/authorized_keys
generally).
Another guess would be that the correct key isn't be selected. Some things I would try are:
Resetting the keys pass-phrase using ssh-keygen
, like this...
$ ssh-keygen -f ~/.ec2/key.ppk -p
This will confirm if in fact your key does (or does not) have a pass-phrase on it already.
Secondly I'd try connecting using a verbose output, specifying your public key explicitly output:
$ ssh host -i ~/.ec2/key.ppk -vvv
This will give you more of an idea of what is going on.
You have wrong value for AuthorizedKeysFile parameter. From man sshd_config:
AuthorizedKeysFile may contain tokens of the form %T which are substituted during connection set-up.
The following tokens are defined: %% is replaced by a literal '%', %h is replaced by the home directory of the user being authenticated and %u is replaced by the username of that user.
After expansion, AuthorizedKeysFile is taken to be an absolute path or one relative to the user's home directory. The default is ".ssh/authorized_keys".
Best Answer
When you connect from Linux, you need to convert the private key from ppk format (understood by windows programs) to openssh format.
There is answer for this question on Stack Overflow.
You need to:
Conversions->Export OpenSSH
and export your private key from PuttyGEN after loading your PRIVATE key.