Identity filename completion for ssh-add would be nice
Bug #376546 reported by
Juhamatti Niemelä
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash-completion (Ubuntu) |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
Binary package hint: bash-completion
Bash could complete filename parameter for ssh-add by using file listing from ~/.ssh/* excluding .pub and ssh config files.
Attached file contains function to implement this feature, if it's copied to /etc/bash_
tags: | added: wishlist |
tags: |
added: patch removed: wishlist |
summary: |
- [wishlist] Identity filename completion for ssh-add would be nice + Identity filename completion for ssh-add would be nice |
To post a comment you must log in.
Hello Juhamatti, thanks for submitting this feature request back in 2009.
I've marked it as confirmed.
Feedback on the patch:
1) you do not need to do --color=none when piping to a nother command. ls knows when its output is not a TTY to not to use any terminal control.
2) instead of trying to guess the names to filter out, you can make use of the file command...
$ file .ssh/* hosts.old: ASCII text, with very long lines
.ssh/config: ASCII text
.ssh/id_rsa: PEM RSA private key
.ssh/id_rsa.pub: OpenSSH RSA public key
.ssh/known_hosts: ASCII text, with very long lines
.ssh/known_
3) the cmdline switches would be good too
4) ssh-add takes arbitrary file arguments, so make sure to detect when a path is already there, and utilize that instead of substituting ~/.ssh