Linux CLI Connect Manager?

Solution 1:

What about using the ~/.ssh/config file? Easy to use, maintain and share with others. If you need to share it then a Git repository for it would be perfect.

The file looks like this:

Host somename
  User username
  HostName 192.168.1.X
  Port 2222

Man ssh_config for more options.

Solution 2:

Here is some code from my .zshrc file. It will auto complete the hosts from /etc/hosts, a list you can manage, and those you have connected to before (if you have 'HashKnownHosts no' set in your ssh config). Setting 'HashKnownHosts no' could be considered a security risk because users that already have access to your $HOME/.ssh/known_hosts file could see the systems you have connected to before. This was stolen from grml configs.

if is42 ; then
    [[ -r ~/.ssh/known_hosts ]] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
    [[ -r /etc/hosts ]] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
else
    _ssh_hosts=()
    _etc_hosts=()
fi
hosts=(
    $(hostname)
    "$_ssh_hosts[@]"
    "$_etc_hosts[@]"
    example.com
)
zstyle ':completion:*:hosts' hosts $hosts

After adding that everything works like magic.