[root@jenkins .ssh]# ssh-copy-id -i id_rsa_driver.pub email@example.com The authenticity of host '192.168.0.96 (192.168.0.96)' can't be established. RSA key fingerprint is a7:78:59:bd:6b:a5:02:3c:6e:85:9a:4c:7b:08:77:48. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.0.96' (RSA) to the list of known hosts. Permission denied (publickey,password).
When multiple pairs of public and private keys are used, this problem often occurs due to improper operation sequence. The correct operation steps are as follows:
ssh-copy-id -i id_rsa_driver.pub firstname.lastname@example.org
Host 192.168.0.96 HostName 192.168.0.96 PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa_driver user root