]> thyrsus.com Git - ssh-installkeys.git/commitdiff
More polishing.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 14 Dec 2006 05:01:07 +0000 (05:01 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 14 Dec 2006 05:01:07 +0000 (05:01 +0000)
sshauth

diff --git a/sshauth b/sshauth
index 5a8190796516569415993b649ffc6ad93dc08b07..5ec41a494e4c01a00b20fd641790b4778f26d918 100755 (executable)
--- a/sshauth
+++ b/sshauth
@@ -107,7 +107,7 @@ echo "I see the following public keys: $public_keys"
 set -- `echo $public_keys | sed -e '/.pub$/s///g'`
 for private_key in $*
 do
-    legend="'${private_key}' corresponding to '${private_key}.pub'"
+    legend="Private '${private_key}' corresponding to '${private_key}.pub'"
     if [ -r $private_key ]
     then
        echo "$legend exists and is readable."
@@ -129,6 +129,8 @@ fi
 agent="
 #!/bin/bash
 # Agent script generated by sshauth.
+TERM=dumb      # This magic prevents some classes of problems
+export TERM    # if you have a shell profile on the remote machine.
 
 checkonly=$check
 
@@ -165,7 +167,7 @@ then
 fi
 fixperms .ssh
 
-if [ -x .ssh/authorized_keys ]
+if [ -f .ssh/authorized_keys ]
 then
     echo \"Remote authorized_keys file will not be overwritten.\"
     echo \"To remove it, do 'sshauth -d ${user}@${host}'.\"
@@ -173,12 +175,14 @@ then
 elif [ \$checkonly = 'yes' ]
 then
     echo \"Remote .ssh exists, authorized_keys could be installed.\"
+    exit 0
 else
     echo \"Creating remote .ssh/authorized_keys file...\"
     cat >.ssh/authorized_keys <<EOF
 `cat $public_keys`
 EOF
 fi
+# End of agent script
 "
 
 if [ "$check" = 'yes' -a "$verbose" = '-v' ]
@@ -186,7 +190,7 @@ then
     echo "Here is the agent script that would be run:"
     echo "$agent" 
     exit 0
-elif echo "$agent" | ssh -T ${quiet} ${user}@${host}
+elif echo "$agent" | ssh -T ${verbose} ${quiet} ${user}@${host}
 then
     echo "Installation or check successful."
     exit 0