From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Samuel Subject: Re: SSH Athentification with public key Date: Wed, 28 May 2003 16:06:36 -0700 Sender: linux-admin-owner@vger.kernel.org Message-ID: <3ED540FC.5060201@bcgreen.com> References: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Keith Morse Cc: Matt Hemingway , =?ISO-8859-1?Q?Gerd_M?= =?ISO-8859-1?Q?=FCller?= , linux-admin@vger.kernel.org Keith Morse wrote: > > > So far, the following is my favorite way of doing this. > > function putkey { > [ $# -eq 1 ] || return 1 > { fgrep -q $1 /etc/hosts || host $1 > /dev/null; } || return 1 > cat $HOME/.ssh/id_dsa.pub | ssh $1 'cat >> .ssh/authorized_keys' > } > > > > You'll need to adjust accordingly for rsa keys. cat $HOME/.ssh/id_?sa.pub | ssh $1 'cat >> .ssh/authorized_keys' The question mark should get both dsa and rsa keys in one shot. -- Stephen Samuel +1(604)876-0426 samuel@bcgreen.com http://www.bcgreen.com/~samuel/ Powerful committed communication, reaching through fear, uncertainty and doubt to touch the jewel within each person and bring it to life.