cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
841
Views
0
Helpful
1
Replies

Linux jump stations setup

Frank Osberg
Level 4
Level 4

Hi all,

 

Ok I have a small issue that I hope all your smart brians can solve for me. :) 

 

I am setting up a linux jump stations that has to be used for connection to our switches etc, instead of direct access to things. 

I am setting up a records for all switches etc, so the plan is that I just want to type in the a record name of the switch and it will connect to it. 

fx. switch01.domainname.com We did this on my old job, but I cannot remeber what it toke to get this done. 

So what I was thinking of doing was making a small bash file pr. switch, where you have the following command in


!/bin/bash
ssh switchname.domainname.com

 

So my problem is here....

 

1: How do I get it to list all the records that I have using my tab?

 

2: How can I do this without having to use ssh infront fx. ssh switchname.domainname.com, so simple just type in the switchename etc. or do I have to put in ssh in front? 

 

3: in the bash script do I need something else in here or what do you think?? 

 

Hope that someone can help me with a solution here on :) 

 

Frank

1 Reply 1

Francesco Molino
VIP Alumni
VIP Alumni
Hi

First of all, there is a tool that do that and much more. It's called Rancid. You can take a look, is very simple to install.

To do auto completion, you need to configure a bash completion script. Here is a link where there was already a discussion:
https://unix.stackexchange.com/questions/136351/autocomplete-server-names-for-ssh-and-scp

Try that and if that doesn't work let me know I'll help you.

To avoid typing ssh in front of each switch names, you gonna need to do alias in a .bashrc file.


Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question
Review Cisco Networking for a $25 gift card