I'm looking for a feature that help me to autocomplete the servers I "sshed" in sometime and are in my .bash_history
file without messing with known_hosts
file or /etc/bash_completition
, just grab them from my history
.
I cannot mess with the known_hosts
file because the info in there is like "encrypted" and looking how to avoid this is like not that important.
e.g.
$ tail -n 2 ~/.ssh/known_hosts
|1|D90I41jNxFy83ZhAoyG7gj0+LpM=|Zkru+0Yi9Q9UNafHpj1IVMGGnAw= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArih5PrEeGsMHm+9ytkiiOgNNIh6fQAEFfdDw9IwkOGs13g+YN6k61rRbdXj97N+vvuGslcCL9uDMY+M6bqDX4k2kGJuvmsSBgIWOjOiOtrW6wWaflGO0OKQ39F1R92Bw3gB1kNg8Es3XjNE1D+CRXt/EQLWLBFmF3p41PpoRg/Gyvw4XqQSMOYdGsr0OaE8ozrXWO2rQo2NDe6BDJzSGqZ234jCtnRLEtFBFvisTEbNCYFRkhKMSfrUecyK5bjHRehEHKfsPxNDTCOl7xrx1DDTng/BIgxyCA21s+xa05oNulkMMd/1qNrekoUUFxwJpb1rf6vrW5CkeMIOhCr5Nxw==
|1|Cl6c716uEoPmovaRDDwkM+bYFTc=|VXUrsTRDptMOg/Nm3anFMwjy5O8= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArih5PrEeGsMHm+9ytkiiOgNNIh6fQAEFfdDw9IwkOGs13g+YN6k61rRbdXj97N+vvuGslcCL9uDMY+M6bqDX4k2kGJuvmsSBgIWOjOiOtrW6wWaflGO0OKQ39F1R92Bw3gB1kNg8Es3XjNE1D+CRXt/EQLWLBFmF3p41PpoRg/Gyvw4XqQSMOYdGsr0OaE8ozrXWO2rQo2NDe6BDJzSGqZ234jCtnRLEtFBFvisTEbNCYFRkhKMSfrUecyK5bjHRehEHKfsPxNDTCOl7xrx1DDTng/BIgxyCA21s+xa05oNulkMMd/1qNrekoUUFxwJpb1rf6vrW5CkeMIOhCr5Nxw==
I found this solution but for other not important reason, I have not the ~/.ssh/config
file.