mathiasbynens / mathiasbynens/dotfiles
Use .ssh/known_host for tab completion on ssh, scp, sftp
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 31.5k
- Forks
- 8.4k
- PR merge metrics
- No merged PRs in 30d
Description
Why not use `~/.ssh/knownhosts` for tab completion on `ssh`, `scp`, `sftp`.
This way you have easier access to other hosts.
I use the following command:
``` bash
HOSTLIST=$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | cut -f 1 -d ':' | cut -f 1 -d ']' | cut -d '[' -f2`;)
complete -W "${HOSTLIST}" ssh sftp scp
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the repository's shell completion configuration and the issue's sample command, then inspect how host names can be read from ~/.ssh/known_hosts. Done means ssh, scp, and sftp tab completion include the relevant known hosts without breaking existing completion behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, shell
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100