From man ssh-add
:
ssh-add adds private key identities to the authentication agent,
ssh-agent(1). When run without arguments, it adds the files
~/.ssh/id_rsa, ~/.ssh/id_dsa, ~/.ssh/id_ecdsa and ~/.ssh/identity.[...]
Identity files should not be readable by anyone but the user. Note that
ssh-add ignores identity files if they are accessible by others.
So, because of The agent has no identities.
error, you probably don't have those files or maybe those files are accessible by others. You can check these using the following command:
ls -l ~/.ssh
Also, after you run ssh-add
command, run echo $?
to see the error status of the previous command. If exit status returned 0, the command was executed successfully. If exit status returned a non-zero value, the command failed to execute.
See man ssh-add
for more info.