From owner-freebsd-stable@FreeBSD.ORG Fri Feb 28 23:08:41 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8C4180 for ; Fri, 28 Feb 2014 23:08:41 +0000 (UTC) Received: from mail-qc0-x233.google.com (mail-qc0-x233.google.com [IPv6:2607:f8b0:400d:c01::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6E6C812FB for ; Fri, 28 Feb 2014 23:08:41 +0000 (UTC) Received: by mail-qc0-f179.google.com with SMTP id m20so1270476qcx.10 for ; Fri, 28 Feb 2014 15:08:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=is+TMv3atVg3Odrnf/9P8wM7wbzOLvYI1OwmBLk2UTU=; b=eK7DxOwVHHCeS6Si7IS6AlKiQx1GAMVc7GJzWNqL4cbb2zhRbnexpXWBo/06icjFoJ SCnczTnNoMmrCXbqTgh/1wP4Da7SBFElH7y7MHr8olWGPcf5MmplwN7w2bWZ4FicSeL0 077ZbhYPuN7lku155Jow/OBbFOJTo9UNzL2to= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=is+TMv3atVg3Odrnf/9P8wM7wbzOLvYI1OwmBLk2UTU=; b=avWcCFc4vcYlVqImtZWDjjmUNttFkYvyeq2SvrZiDFBx02D4/QwT7NnV/00/AsjpFm w60V6DJzgPgyFfzkYDM8YEdeI4Pi8vkI/O+Gp/IY5pNuF1HnlRe+X/RTH/ijQsn9Upob cJe13Gn4ii1Pq7tR23F/otQ7kj4F79rWmFJfGIia13s1OnvuFgExKggSu9iT6ee5IeiR RZNd2McEaxOUThNgBW/wZJoc/Qz0m/qijdHVYhh0NJwq/6zL6ZBM+G2Gnn3yVyhrnFmU J88d3OvkAdlqLlzdEz+SbOwpUtIyDjby7Oj+OVpMixd2gg5h/VqqRMMAgqgsrsXU+0ug 1uYA== X-Gm-Message-State: ALoCoQmFeNsbaAYHqBBQovH3HWGu8Vt0cMAfhGekxRUmNKSThj11NhD+ql5j3s2dXHo/Uh+nCOrT X-Received: by 10.140.87.172 with SMTP id r41mr6923151qgd.101.1393628920605; Fri, 28 Feb 2014 15:08:40 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.147.225 with HTTP; Fri, 28 Feb 2014 15:08:10 -0800 (PST) In-Reply-To: <1393625741.9928.89141917.3B723B0F@webmail.messagingengine.com> References: <2cba8fd9cc51dedc1bd5e127046f4ab7@dweimer.net> <1393618827.9046.89104957.4A974C56@webmail.messagingengine.com> <1393625741.9928.89141917.3B723B0F@webmail.messagingengine.com> From: Eitan Adler Date: Fri, 28 Feb 2014 18:08:10 -0500 X-Google-Sender-Auth: TA0-dx6UCizK7wq2uk80QLtWixE Message-ID: Subject: Re: ssh-copy-id To: Mark Felder Content-Type: text/plain; charset=UTF-8 Cc: freebsd-stable X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 23:08:41 -0000 On 28 February 2014 17:15, Mark Felder wrote: .... > In my opinion, if I'm using an ssh utility and I specify "-i" flag it > should be the private key. Hey all, Sorry about the confusion ssh-copy-id has caused you. Does the following patch help ? Index: ssh-copy-id.1 =================================================================== --- ssh-copy-id.1 (revision 262539) +++ ssh-copy-id.1 (working copy) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2012 +.Dd Feburary 28, 2014 .Dt SSH-COPY-ID 1 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd copy public keys to a remote host .Sh SYNOPSIS .Nm -.Op Fl l +.Op Fl lv .Op Fl i Ar keyfile .Op Fl o Ar option .Op Fl p Ar port @@ -48,12 +48,14 @@ file (creating the file and directory, if required The following options are available: .Bl -tag -width indent .It Fl i Ar file -Copy the key contained in +Copy the public key contained in .Ar file . This option can be specified multiple times and can be combined with the .Fl l option. +If a private key is specified and a public key is found then the public key +will be used. .It Fl l Copy the keys currently held by .Xr ssh-agent 1 . @@ -67,6 +69,9 @@ This option can be specified multiple times. .It Fl p Ar port Connect to the specified port on the remote host instead of the default. +.It Fl v +Pass -v to +.Xr ssh 1 . .El .Pp The remaining arguments are a list of remote hosts to connect to, Index: ssh-copy-id.sh =================================================================== --- ssh-copy-id.sh (revision 262539) +++ ssh-copy-id.sh (working copy) @@ -28,7 +28,7 @@ # $FreeBSD$ usage() { - echo "usage: ssh-copy-id [-l] [-i keyfile] [-o option] [-p port] [user@]hostname" >&2 + echo "usage: ssh-copy-id [-lv] [-i keyfile] [-o option] [-p port] [user@]hostname" >&2 exit 1 } @@ -64,11 +64,14 @@ options="" IFS=$nl -while getopts 'i:lo:p:' arg; do +while getopts 'i:lo:p:v' arg; do case $arg in i) hasarg="x" - if [ -r "$OPTARG" ]; then + if [ -r "${OPTARG}.pub" ]; then + echo helo + keys="$(cat -- "${OPTARG}.pub")$nl$keys" + elif [ -r "$OPTARG" ]; then keys="$(cat -- "$OPTARG")$nl$keys" else echo "File $OPTARG not found" >&2 @@ -85,6 +88,9 @@ IFS=$nl o) options=$options$nl-o$nl$OPTARG ;; + v) + options="$options$nl-v" + ;; *) usage ;; -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams