/usr/bin/ssh-copy-id: ERROR: failed to open ID file ‘.pub‘: No such file or directory
作者:花生_TL007 | 2024-04-16 16:59:21
赞
踩
/usr/bin/ssh-copy-id: error: failed to open id file '/root/.pub': no such fi
在添加ssh免密登录时,报ssh公钥不存在:
经过仔细排查,发现在生成ssh密钥的时候输错了指令:
此处应该直接回车,而不是输入yes,这会导致ssh公钥另存为当前目录的yes.pub文件当中,所以在执行ssh-copy-id命令时,如果不显式指定公钥文件,将会报错,/usr/bin/ssh-copy-id: ERROR: failed to open ID file ‘.pub’: No such file or directory: