How do you install ssh-copy-id on a Mac?

MacosSshHomebrewSsh Keys

Macos Problem Overview


I am having trouble trying to install ssh-copy-id on my Mac. I have tried to follow https://github.com/beautifulcode/ssh-copy-id-for-OSX but every time I run ssh-copy-id it gives me errors. Any ideas on how to get ssh-copy-id to install?

Macos Solutions


Solution 1 - Macos

You can install it using Homebrew:

brew install ssh-copy-id

If you don't want to use Homebrew, you can use this Mac port:

curl -L https://raw.githubusercontent.com/beautifulcode/ssh-copy-id-for-OSX/master/install.sh | sh 

Solution 2 - Macos

MacPorts version: sudo port install openssh +ssh-copy-id

Solution 3 - Macos

ssh-copy-id is installed on macOS by default now.

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.12.4

$ which ssh-copy-id
/usr/bin/ssh-copy-id

Solution 4 - Macos

The above methods do not work on old Macs. I have a lion OS. use this instead because the ssh-copy-id can not be installed with brew on old PCs due to compiling dependencies errors at ssl.

cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >>  ~/.ssh/authorized_keys"

credit goes to this site

Solution 5 - Macos

install homebrew then $ brew install ssh-copy-id

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTechnic1anView Question on Stackoverflow
Solution 1 - MacosnwinklerView Answer on Stackoverflow
Solution 2 - MacosVictor SergienkoView Answer on Stackoverflow
Solution 3 - MacosRyanView Answer on Stackoverflow
Solution 4 - MacosSherif O.View Answer on Stackoverflow
Solution 5 - MacosvikranttView Answer on Stackoverflow