I have a CentOS 6 server and I want to connect to it with a private key.
On Windows, I use PuTTY Keygen and paste the public key in my server, in
.ssh/authorized_keys2 (also tried
authorized_keys, don't remember why I'm using
Then, I save the private key "name.ppk" and use it with PuTTY (and pageant). Everything is ok until there. The connection is successful.
The problem comes when I try to connect from another Linux system.
I use the puttykeygen export option to export an OpenSSH key and use it from my other Linux system, but it doesn't work. It always says
Permission denied (publickey,gssapi-with-mic)
Also tried to create the key from the other Linux systems with:
ssh-keygen -t dsa
-t rsa) and pasted the public key on my CentOS server, where I want to connect. I've tried to paste it in both files (
authorized_keys2) but nothing works.
In fact, I've tried to connect from another real CentOS server, one CentOS virtual server on the same Windows 7 that can connect using PuTTY and one Debian virtual server on that same Windows 7.
The CentOS virtual server and Debian virtual server can connect to each other using keys.
Also, the config is different. Both virtual servers have the
sshd_config as default, while the main CentOS 6 server has a config I've found years ago trying to do it safer, disabling the login without key, etc.
Here is my CentOS 6 config (without some comments):
Port xxxx Protocol 2 SyslogFacility AUTHPRIV PermitRootLogin yes PasswordAuthentication no ChallengeResponseAuthentication no GSSAPIAuthentication yes GSSAPICleanupCredentials yes UsePAM no AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT AcceptEnv LC_IDENTIFICATION LC_ALL X11Forwarding yes UseDNS no Subsystem sftp /usr/libexec/openssh/sftp-server