Linux CLI Connect Manager?

6

1

I am looking for a connection manager for Linux that runs in the CLI. To be clear, by connection manager I mean a program that allows you to create, save, and quickly launch remote connections. Similar to mRemote, mRemoteNG, Vrd, Terminals, Devolutions RDM, etc. You should be able to define a connection type (ssh), destination (IP or DNS), and paramerts such as SSH version, username/password, etc

We are in the process of tightening up security in a large manager service provider environment and will be creating a couple of "hop-off" linux boxes. The idea is that our team and level 1 support will SSH to those linux servers, and then from there connect to various pieces of network equipment throughout the environment. It is both more secure and required because of some of the routing (VRF's) in place.

Ideally I am hoping that solution stores connection in mySQL or similar so that we can easily access one library of connections from multiple machines (hop-off boxes).

Has anyone encountered a program or project like this? I have found a few apps for Linux, such as Remmmina, Monocaffe, and PAC Manager, but they are all GUI. I don't want to have to VNC into the hop off boxes since we only need CLI for SSH anyway.

Thanks!

Mike M

Posted 2012-02-09T14:04:30.477

Reputation: 730

What about aliases? I have a couple on my home machine like this: alias sshandy='ssh user@connection.com -P 443 -i ~/sshandy' andalias sshacer='ssh 192.168.1.10'` It might not be perfect, but it's definitely doable. – Rob – 2012-02-09T16:36:13.377

Rob. That would be a potential solution, but I am looking for something more scalable. Creating new aliases wouldn't be too bad, but updating existing ones and removing them would be pretty cumbersome and error prone (remember L1 support will also use them). We would also have to sync that alias file to the several different servers (which is possible, just not as elegant as I had hoped). I would also like to easily list and search through connectios, Although i guess we could create an alias that to cat & grep that file . Thanks for the suggestion, any others? – Mike M – 2012-02-10T14:18:08.153

1

Seems like a duplicate to this question to me: http://superuser.com/a/214336/51741

– Shadok – 2012-02-13T14:38:25.283

Answers

5

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.

ggustafsson

Posted 2012-02-09T14:04:30.477

Reputation: 1 698

I'm setting mine up like this and removing my aliases. – Rob – 2012-02-13T15:33:19.043

I used aliases too but it's a real hassle. The ssh config works great. I'm lazy so i have this: "for X in $SSH_HOSTS; do alias $X="ssh $X" done" in my ~/.zshrc file so i can just type the hostnames without the "ssh" part :) – ggustafsson – 2012-02-13T15:47:09.023

Oops.. Forgot the most important code "[ -f ~/.ssh/config ] && SSH_HOSTS=($(sed -ne 's/^Host //p' < ~/.ssh/config))" parses the ~/.ssh/config file :) – ggustafsson – 2012-02-13T15:48:15.137

ggustafsson -Does the SSH config file allow for atab auto complete? IE I type "ssh my"{tab} and it completes "ssh myhost" – Mike M – 2012-02-15T21:10:37.087

1

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.

xaocon

Posted 2012-02-09T14:04:30.477

Reputation: 21

0

Written in Ruby it has a nice DSL for storing connections in ~/.sshc file

https://github.com/troydm/sshc

Troydm

Posted 2012-02-09T14:04:30.477

Reputation: 125

0

Use some custom scripts and manage them via Puppet or git. Full customization, easy to manage through puppet or a VCS. Especially since you're not attempting to patch an existing solution, I'd highly recommend doing it custom so you have full control over it.

Chad

Posted 2012-02-09T14:04:30.477

Reputation: 101