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

2019-03-07 17:02发布

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?

5条回答
祖国的老花朵
2楼-- · 2019-03-07 17:30

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 insalled with brew on old pcs due to compiling dependencies errors at ssl.

cat ~/.ssh/id_rsa.pub | ssh user@123.45.56.78 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

credit goes to this site

查看更多
地球回转人心会变
3楼-- · 2019-03-07 17:49

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

查看更多
冷血范
4楼-- · 2019-03-07 17:50

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
查看更多
迷人小祖宗
5楼-- · 2019-03-07 17:52

install homebrew then $ brew install ssh-copy-id

查看更多
Luminary・发光体
6楼-- · 2019-03-07 17:54

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 
查看更多
登录 后发表回答