ssh-copy-id is a very useful tool to quickly gain passwordless access to a server. However, it does not always work right away.
I've encountered this problem enough times to have written a script that will check for possible problems.
It requires 1 argument, the host to connect to, and will request for a password on the command line. Then it will check all of the following, which are known to cause some problems:
- are there public key files?
- sshd_config at the host
- permission of .ssh/authorized_keys, ~/.ssh and ~
The source code can be view below, and downloaded on this link.
- ssh (obviously)
- perl (to obtain permissions in a OS-agnostic way)
If you know other causes of problems, please inform me so I can add them :)