ssh-copy-id报错
错误
登录后复制
[root@jenkins .ssh]# ssh-copy-id -i id_rsa_driver.pub root@192.168.0.96The 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).
解决办法
采用多对公钥私钥时,由于操作顺序不当常会出现此问题,正确操作步骤如下:
ssh-copy-id -i id_rsa_driver.pub root@192.168.0.96
修改config配置文件内容如下:
登录后复制
Host 192.168.0.96HostName 192.168.0.96PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa_driver user root
©著作权归作者所有:来自51CTO博客作者举树的蚂蚁的原创作品,如需转载,请注明出处,否则将追究法律责任