在添加ssh免密登录时,报ssh公钥不存在:

经过仔细排查,发现在生成ssh**的时候输错了指令:

/usr/bin/ssh-copy-id: ERROR: failed to open ID file '.pub': No such file or directory

此处应该直接回车,而不是输入yes,这会导致ssh公钥另存为当前目录的yes.pub文件当中,所以在执行ssh-copy-id命令时,如果不显示指定公钥文件,将会报错,/usr/bin/ssh-copy-id: ERROR: failed to open ID file ‘.pub’: No such file or directory:

/usr/bin/ssh-copy-id: ERROR: failed to open ID file '.pub': No such file or directory

所以我们不需要将ssh公钥另存,直接按默认路径存储即可:

/usr/bin/ssh-copy-id: ERROR: failed to open ID file '.pub': No such file or directory

相关文章: