ssh-tools icon indicating copy to clipboard operation
ssh-tools copied to clipboard

ssh-ping mit Autovervollständigung

Open lachenmeiers opened this issue 4 years ago • 4 comments

Hallo Verdampfen,

Kann du bitte in SSH-Ping von den SSH-Config die Hosts Eintrage nehmen wie auch von der known_hosts Datei? War mega, wenn dies gehen würde.

lachenmeiers avatar Jan 03 '22 23:01 lachenmeiers

Not a final solution, but a quick workaround to use existing completions

Bash

can be put into your local Bash config

complete -F _ssh ssh-ping
ssh TAB-TAB      # see why: https://stackoverflow.com/a/61544119

ssh-ping TAB-TAB

vaporup avatar Jan 04 '22 17:01 vaporup

Ubuntu (and maybe others) ship completions which can be used.

Bash

complete -F _known_hosts ssh-ping

Zsh

compdef _ssh_hosts ssh-ping

Fish

complete -c ssh-ping -a "(__fish_print_hostnames)"

vaporup avatar Jan 16 '22 17:01 vaporup

Why i cant leave a new issue?

Pong with Ip address: it will be nice to know the ip of the ping'ing server. In most time when using completition, you dont know the ip (therefore you use it :-) ), only the name of the host.

So please print also the ip of the pinging host on cli.

Bfo

bforpc avatar Aug 01 '22 14:08 bforpc

I don't think there is a reliable way to get this information. You can't rely on DNS especially not if you go through Jump hosts. So ssh-ping needs to get this info from the target system itself. But that means it has to run some shell code which has to be very portable and also sophisticated because possibly there are many interfaces etc...

So, I am not going to implement this until someone knows a very simple solution.

vaporup avatar Aug 30 '22 18:08 vaporup