Another question about this shell magic...

Martin Drescher drescher at snafu.de
Thu Oct 1 22:43:38 AEST 2020


On 01.10.20 14:25, Brian Candler wrote:
> On 01/10/2020 13:06, Martin Drescher wrote:
>> what confuses me a bit is this shell(?) magic: When I type 'ssh ' on my console an hit the TAB twice, I get a list of host I would probably ssh to. This list does not come from an element in my bash history. On my initial question, I guessed this would somehow come from the known_hosts file. Does it?
>> Can someone tell how this magic works?
> 
> Under Ubuntu 18.04, it appears to be giving me everything in /etc/hosts *and* everything in ~/.ssh/known_hosts
> 
> For the magic see:
> 
> /usr/share/bash-completion/completions/ssh
> 
> /usr/share/bash-completion/bash_completion   # function _known_hosts_real()

Oh, ok, I see there is no real magic. There are some hosts in my known_hosts, which have not been hashed. How this would happen, I don't know.


Thanks, pointing me to function _known_hosts_real() did the trick.


--

 Martin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20201001/c8ef6903/attachment.asc>


More information about the openssh-unix-dev mailing list