[Nottingham] ssh and tab autocomplete in BASH

Martin martin at ml1.co.uk
Fri Nov 16 13:56:27 UTC 2018


Jason,

This sounds like a 'good one' :-)

Checking my ".ssh/known_hosts" shows that indeed my autocomplete uses
that file. The host names and IP addresses are in plain text that is
then followed by a hash.


Let us know what you find! Very curious...

Good luck!

Cheers,
Martin



On 16/11/2018 12:00, J via Nottingham wrote:
> Well that's weird, a grep of the entire filesystem returns nothing for
> the spelling mistakes, yet they are still present in autocomplete.
> 
> As for known_hosts, the names are all hashed; so I doubt they're coming
> from there.
> 
> On Fri, 16 Nov 2018 at 10:41, J wrote:

>     Yeah, I recognise the misspelling and I know I did it; I just can't
>     find out where the little sod it stored (other than in
>     .bash_history, it's gone now).
> 
>     Human readable text files are only good when you know where they are!
>     A "grep -r mistook /" it is then.
> 
>     On Thu, 15 Nov 2018 at 17:21, Martin via Nottingham wrote:

>         Jason,
> 
>         Something added to your /etc/hosts file or something getting
>         added to
>         your bash aliases?
> 
>         Do you recognise the misspelling?
> 
>         A new host added to your network?...
> 
> 
>         And in all desperation... You could try a:
> 
>         grep -r 'misspelling_annoyance' wherever/likely/or/possible
> 
> 
>         Such is the beauty of human readable text config files and a
>         consistent
>         set of tools to access them!
> 
>         (Cue signature song for Brick in The Wall:
> 
>         We don't need no steenking systemd...
>         We don't need no registrys...
>         ...
>         System! Leave that binary alone!)
> 
>         :-)
> 
> 
>         Good luck?
> 
>         Cheers,
>         Martin
> 
> 
>         On 15/11/2018 16:47, J via Nottingham wrote:
>         > Hello all,
>         >
>         > Tab autocomplete is a wondrous thing when it works and for
>         quite a while
>         > it was for me. I have ~.ssh/config set-up with my various
>         servers and
>         > keys and it was great to be able to type "ssh a[TAB]" and have
>         it fill
>         > in the rest.
>         > Due to various stages of fat-fingering, it is now no longer fully
>         > auto-completing as it has got some spellign misteaks stored
>         somewhere.
>         > Does anyone have any idea where that somewhere is?
>         > I've tried mucking around with "complete", but it doesn't
>         report back
>         > any of the misspelled server names.
>         > All I really want to do is reach into the file (or whatever)
>         and removed
>         > the duff entries.
>         > Cheers,
>         >
>         > J.




More information about the Nottingham mailing list