Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[patch] ssh -i: don't complete group/world readable files



SSH requires identity files to be readable only by the owner. We can use
this to not complete files that can't be keys. This will normally ignore
*.pub files as by default they're 0644.

- Matthew MArtin


diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh
index a66702a..24706f9 100644
--- a/Completion/Unix/Command/_ssh
+++ b/Completion/Unix/Command/_ssh
@@ -18,7 +18,7 @@ _ssh () {
     # for protocol version 2, this can be a comma-separated list
     '-c+[select encryption cipher]:encryption cipher:(idea des 3des blowfish arcfour tss none)'
     '-F+[specify alternate config file]:config file:_files'
-    '*-i+[select identity file]:SSH identity file:_files'
+    '*-i+[select identity file]:SSH identity file:_files -g "*(^AR)"'
     '*-o+[specify extra options]:option string:->option'
   )
   common_transfer=(



Messages sorted by: Reverse Date, Date, Thread, Author