如何解决ssh copy id“ERROR:failed To open id file”错误

ssh 提供对远程系统控制台或命令行的安全访问。所有linux机箱都使用 ssh 安全地。在连接和使用ssh时,有很多步骤可以使事情变得安全和简单。 ssh 使用证书提供无密码身份验证。我们可以用 ssh-copy-id 将证书发送到远程系统,但如果出现以下错误,我们该怎么办

null
/usr/bin/ssh-copy-id: ERROR: failed to open ID file '/home/ismail/.pub': No such file         (to install the contents of '/home/ismail/.pub' anyway, look at the -f option)

尝试ssh copy id

现在我们要复制ssh公共证书 ssh-copy-id 命令。我们只提供要复制的远程主机。用户将是当前用户名 ismail 在这种情况下。我们还可以指定用户名,如 [email protected] .

$ ssh-copy-id poftut1

图片[1]-如何解决ssh copy id“ERROR:failed To open id file”错误-yiteyi-C++库

使用ssh-keygen生成证书

正如我们从错误文本中看到的,我们没有任何证书对。我称之为证书对,因为有两个名为 public private . private 证书安全地保存在我们的系统中 public 证书被分发到其他系统。我们将使用 ssh-keygen 使用默认设置创建证书对。更详细的关于 ssh-keygen 可以在下面的帖子中找到。

Linux下如何用Ssh-keygen生成Ssh密钥

$ ssh-keygen
Generate Certificates with ssh-keygen
使用ssh-keygen生成证书

使用ssh Copy id复制证书

现在我们可以毫无问题地将证书复制到远程系统。

$ ssh-copy-id poftut1
Copy Certificates with ssh-copy-id
使用ssh Copy id复制证书

相关文章: 有用的Linux命令

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享