]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-post-file: Ignore keys offered by ssh-agent 11746/head
authorDavid Galloway <dgallowa@redhat.com>
Fri, 19 Aug 2016 20:11:32 +0000 (16:11 -0400)
committerSage Weil <sage@redhat.com>
Wed, 2 Nov 2016 13:37:50 +0000 (09:37 -0400)
In my case, I had multiple private keys in ssh-agent which resulted in
the sftp connection failing despite explicitly specifying the private
key to use

Signed-off-by: David Galloway <dgallowa@redhat.com>
(cherry picked from commit a61fcb2eac35a149b49efdc9b2ffa675afb968e8)

src/ceph-post-file.in

index 07da4a2c5087c89c80ba4637fa082484342b11bc..3c9884a149991c1d3ec619f348ea5cd359c25c0a 100755 (executable)
@@ -151,6 +151,7 @@ done
 
 # no UserKnownHostsFile so that we don't try to record the IP hash key
 # GlobalKnownHostsFile so that we are verifying that this is the real drop.ceph.com
+# IdentitiesOnly=yes forces sftp to ignore any keys offered by ssh-agent
 
 cp "$ssh_key" "$t4"
 cp "${ssh_key}.pub" "$t4.pub"
@@ -160,6 +161,7 @@ sftp -o "IdentityFile=$t4" \
     -oCheckHostIP=no \
     -oGlobalKnownHostsFile=$known_hosts \
     -oBatchMode=no \
+    -oIdentitiesOnly=yes \
     -b $t1 -- $remote
 
 echo "$0: copy the upload id below to share with a dev: