Please consider this simple ssh-copy-id patch,
and adding contrib/ssh-copy-id as install target for cygwin. (man and shellscript)


20041113
 - [contrib\ssh-copy-id]: change default to newest .ssh/id*.pub
        From: Reini Urban [EMAIL PROTECTED]

--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
--- openssh-3.9p1-2/contrib/ssh-copy-id.orig    2004-01-04 22:16:34.001000000 
+0100
+++ openssh-3.9p1-2/contrib/ssh-copy-id 2004-11-13 13:53:04.167750000 +0100
@@ -1,11 +1,13 @@
 #!/bin/sh
 
-# Shell script to install your identity.pub on a remote machine
+# Shell script to install your newest identity.pub onto a remote machine.
 # Takes the remote machine name as an argument.
 # Obviously, the remote machine must accept password authentication,
 # or one of the other keys in your ssh-agent, for this to work.
+# TODO: check if already in?
 
-ID_FILE="${HOME}/.ssh/identity.pub"
+#ID_FILE="${HOME}/.ssh/identity.pub"
+ID_FILE="$(ls -t ${HOME}/.ssh/id*.pub | head -n1)"
 
 if [ "-i" = "$1" ]; then
   shift
@@ -41,9 +43,11 @@
 { eval "$GET_ID" ; } | ssh $1 "umask 077; test -d .ssh || mkdir .ssh ; cat >> 
.ssh/authorized_keys" || exit 1
 
 cat <<EOF
-Now try logging into the machine, with "ssh '$1'", and check in:
+Appended ${ID_FILE} to $1:.ssh/authorized_keys
 
-  .ssh/authorized_keys
+Now try logging into the machine, with "ssh '$1'", and check:
+
+  ~/.ssh/authorized_keys
 
 to make sure we haven't added extra keys that you weren't expecting.
 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply via email to