]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
avoid exploring .ssh/id*.pub subdirectories
authorPhilip Hands <phil@hands.com>
Fri, 2 Aug 2024 13:52:07 +0000 (15:52 +0200)
committerDarren Tucker <dtucker@dtucker.net>
Sat, 17 Aug 2024 01:19:36 +0000 (11:19 +1000)
SSH-Copy-ID-Upstream: 0b9e08b7707ad16de3c8e6a0410d9f42fbd56997

contrib/ssh-copy-id

index 80c30132b7ff1b9e7212f4de9c10a7c7d2e7d231..4798a4dbd9829ab76acce365d0688c0d10aa1e1b 100644 (file)
@@ -62,7 +62,7 @@ then
 fi
 
 # shellcheck disable=SC2010
-DEFAULT_PUB_ID_FILE=$(ls -t "${HOME}"/.ssh/id*.pub 2>/dev/null | grep -v -- '-cert.pub$' | head -n 1)
+DEFAULT_PUB_ID_FILE=$(ls -dt "${HOME}"/.ssh/id*.pub 2>/dev/null | grep -v -- '-cert.pub$' | head -n 1)
 SSH="ssh -a -x"
 TARGET_PATH=".ssh/authorized_keys"
 umask 0177