6

I followed instructions at http://www.devthought.com/2009/09/19/get-ssh-copy-id-in-mac-os-x/ in order to get ssh-copy-id to work on my mac. Now I am getting an error when running: 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

I have tried to follow the instructions here: https://github.com/beautifulcode/ssh-copy-id-for-OSX but I every time I run ssh-copy-id I get the same error. How do I fix my situation and get ssh-copy-id to work properly?

Benjamin Bakhshi
  • 663
  • 2
  • 9
  • 22
  • 1
    The `ucgi:: command not found` error comes from a removed repository at the [referenced URL](http://www.chiark.greenend.org.uk/ucgi/~cjwatson/cvsweb/openssh/contrib/ssh-copy-id?rev=1.8;content-type=text%2Fplain). – ConcurrentHashMap Mar 03 '13 at 12:22

3 Answers3

16

IMHO, the simplest way, as you are on a mac, is to use brew.

brew install ssh-copy-id
jlfenaux
  • 3,263
  • 1
  • 26
  • 33
  • Good answer, though sometimes this is less preferable because new Macs don't come installed with Brew when you are setting up your SSH login. – Sridhar Sarnobat Sep 24 '14 at 20:37
12

use the below command

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
Community
  • 1
  • 1
Pradheep
  • 3,553
  • 1
  • 27
  • 35
2

The repository referenced in the first link is broken.

Try installing it this way:

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
ConcurrentHashMap
  • 4,998
  • 7
  • 44
  • 53