【问题标题】:/usr/bin/ssh-copy-id: line 1: ucgi:: command not found/usr/bin/ssh-copy-id: line 1: ucgi:: command not found
【发布时间】:2013-02-17 14:19:54
【问题描述】:

我按照http://www.devthought.com/2009/09/19/get-ssh-copy-id-in-mac-os-x/ 的说明操作,以便让 ssh-copy-id 在我的 mac 上工作。 现在运行时出现错误:ssh-copy-id

/usr/bin/ssh-copy-id: line 1: ucgi:: command not found
stat: script:: stat: No such file or directory
stat: No: stat: No such file or directory
stat: such: stat: No such file or directory
stat: file: stat: No such file or directory
stat: or: stat: No such file or directory
stat: directory: stat: No such file or directory

我尝试按照此处的说明进行操作:https://github.com/beautifulcode/ssh-copy-id-for-OSX 但每次运行ssh-copy-id 时都会遇到相同的错误。如何解决我的问题并让ssh-copy-id 正常工作?

【问题讨论】:

  • ucgi:: command not found 错误来自referenced URL 上的已删除存储库。

标签: macos ssh chmod


【解决方案1】:

第一个链接中引用的存储库已损坏。

尝试这样安装:

sudo curl https://raw.github.com/beautifulcode/ssh-copy-id-for-OSX/master/ssh-copy-id.sh -o /usr/local/bin/ssh-copy-id
sudo chmod +x /usr/local/bin/ssh-copy-id

【讨论】:

  • 我做了这两个步骤,运行时出现同样的错误:ssh-copy-id
  • 这不应该以同样的错误结束(因为 GitHub 代码可用并且不输出这些行!)。您应该确保旧文件在之前被清除或覆盖。
  • 谢谢。我认为我对最后一行的表述并不准确。
【解决方案2】:

使用下面的命令

sudo curl https://raw.githubusercontent.com/beautifulcode/ssh-copy-id-for-OSX/master/ssh-copy-id.sh -o /usr/local/bin/ssh-copy-id
sudo chmod +x /usr/bin/ssh-copy-id

【讨论】:

    【解决方案3】:

    恕我直言,最简单的方法是使用 brew。

    brew install ssh-copy-id
    

    【讨论】:

    • 不错的答案,但有时这不太可取,因为在您设置 SSH 登录时,新的 Mac 不会随 Brew 一起安装。
    猜你喜欢
    • 2017-01-29
    • 1970-01-01
    • 2015-12-02
    • 1970-01-01
    • 2015-05-28
    • 1970-01-01
    • 2020-01-28
    • 2022-12-21
    • 2015-09-26
    相关资源
    最近更新 更多