6

I set up a new system with CentOS 6.5. I copied my public key key with:

ssh-copy-id [email protected]

It took 15+ seconds for the password prompt to show, but then it copied.

However ssh to [email protected] still asks for the password. The permissions on the directory .ssh are 700 and on the file .ssh/authorized_keys 600 (owner & group) root. This is the same as on a server running Debian where public key login is working.

There is no obvious thing in the sshd_config that I could see needs to be changed.

How can I automate public key login? If that is fixed does that help speed up the login?

user52719
  • 35
  • 3
centi
  • 65
  • 1
  • 7
  • Like Anthon said in his answer, the two are actually unrelated problems. Using '-v' option with 'ssh' while logging in will throw some extra light to see what is happening. – Sreeraj Oct 28 '14 at 17:12
  • I tried -v but did not see a problem, but it is solved now thx. – centi Oct 28 '14 at 17:19

1 Answers1

6

They are actually unrelated problems. If the permissions of the .ssh directory and the authorized_keys file are correct run:

restorecon -R -v /root/.ssh

and you should be able to login with your private-public key pair.

To solve the slow login issue you can disable the following entries in /etc/ssh/sshd_config:

GSSAPIAuthentication no
GSSAPICleanupCredentials no

and restart with service sshd restart

Anthon
  • 78,313
  • 42
  • 165
  • 222