Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question
    
What about aliases? I have a couple on my home machine like this: alias sshandy='ssh user@connection.com -P 443 -i ~/sshandy' and alias sshacer='ssh 192.168.1.10'` It might not be perfect, but it's definitely doable. –  Rob Feb 9 '12 at 16:36
    
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 Feb 10 '12 at 14:18
1  
Seems like a duplicate to this question to me: superuser.com/a/214336/51741 –  Shadok Feb 13 '12 at 14:38

3 Answers 3

up vote 3 down vote accepted
+100

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.

share|improve this answer
    
I'm setting mine up like this and removing my aliases. –  Rob Feb 13 '12 at 15:33
    
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 Feb 13 '12 at 15:47
    
Oops.. Forgot the most important code "[ -f ~/.ssh/config ] && SSH_HOSTS=($(sed -ne 's/^Host //p' < ~/.ssh/config))" parses the ~/.ssh/config file :) –  ggustafsson Feb 13 '12 at 15:48
    
ggustafsson -Does the SSH config file allow for atab auto complete? IE I type "ssh my"{tab} and it completes "ssh myhost" –  Mike M Feb 15 '12 at 21:10

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.