Apple OS X install ssh-copy-id script command

Fig.01: Install ssh-copy-id on a OS X Unix systems

Fig.01: Install ssh-copy-id on a OS X Unix systems

First, open the Terminal app. Next, type the following brew command to install ssh-copy-id on a OS X systems.

Installation

I’m using OS X Yosemite:

brew install ssh-copy-id

Sample outputs:

==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/ssh-copy-id-6.7p1.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring ssh-copy-id-6.7p1.yosemite.bottle.tar.gz
🍺  /usr/local/Cellar/ssh-copy-id/6.7p1: 7 files, 216K

Syntax

The syntax is as follows:

Usage: /usr/local/bin/ssh-copy-id [-h|-?|-n] [-i [identity_file]] [-p port] [[-o ] ...] [user@]hostname

Usage and example

In this example, install ssh-key using the following syntax:

ssh-copy-id vivek@nas01

Sample outputs:

/usr/local/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/local/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
vivek@nas01's password: 
 
Number of key(s) added:        1
 
Now try logging into the machine, with:   "ssh 'vivek@nas01'"
and check to make sure that only the key(s) you wanted were added.

Test it (you should able to login with a password):

ssh vivek@nas01
ssh -Y vivek@nas01

Sample outputs:

Linux nas01 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u1 x86_64
 
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
 
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
No mail.
Last login: Sat Feb 14 13:21:36 2015 from 192.168.1.4
$

Examples and usage: Install / Append SSH Key In A Remote Linux / UNIX Servers Authorized_keys