2013-03-03 105 views
6

我按照指示在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:第1行:找不到ucgi ::命令

/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正常工作?

+1

的'ucgi ::命令不found'錯誤來自於[引用URL]被移除的存儲庫(http://www.chiark.greenend.org.uk/ucgi/~cjwatson/cvsweb/openssh /contrib/ssh-copy-id?rev=1.8;content-type=text%2Fplain)。 – ConcurrentHashMap 2013-03-03 12:22:23

回答

12

使用下面的命令

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 
2

第一個鏈接中引用的存儲庫已損壞。

嘗試安裝這樣說:

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 
+0

我做了這兩個步驟,並且在運行時出現同樣的錯誤:'ssh-copy-id' – 2013-03-03 12:25:44

+0

這不應該出現在同一個錯誤中(因爲GitHub代碼可用並且不會輸出這些行! )。您應該確保舊文件在清除之前被清除或覆蓋。 – ConcurrentHashMap 2013-03-03 12:28:11

+0

謝謝。我認爲我對最後一行的準確度不夠。 – 2013-03-03 12:32:31

16

恕我直言,最簡單的方法,因爲你是在Mac上,就是用啤酒。

brew install ssh-copy-id 
+1

只是做到了這一點。現在工作。謝謝。 – cheshireoctopus 2014-01-28 23:52:49

+0

很好的答案,儘管有時候這是不太可取的,因爲當你設置你的SSH登錄時,新的Mac並沒有與Brew一起安裝。 – 2014-09-24 20:37:19