Automation & Tools

SSH Wrapper Script

Tony Mattke · 2008.11.30 · 1 min read

Ok — this is my first script that I’m posting here. Its a VERY simple ssh wrapper script that you can place in your path, preferably in ~/bin

bash
#!/bin/bash
SSH="/usr/bin/ssh"
case "$*" in
 *'@'*)     $SSH $* ;;
 *' -l'*)     $SSH $* ;;
 *)         $SSH -l root $* ;;
 esac

What this allows us to do is ssh as root to another box w/o specifying a user. Very handy if you spend your life in a terminal as I do. This could also be easily modifed for use with SCP or anything you wish…

More in Automation & Tools
comments powered by Disqus

Related Posts

2010.05.16 Routing 2 min read

More BGP tricks

At times, the ‘rules of BGP’ don’t fit the needs of our productions networks. When we get into today’s production networks how often do book configurations apply? I’ll tell you one thing.

2009.06.04 Automation & Tools 3 min read

Regular Expression Basics

Before I even get started, I want to mention that not all regular expression metacharacters are supported in every application. Keep this in mind when building your matches.

2014.10.15 Routing 4 min read

AS-Path Filtering

Before we get into the how, let’s talk about the why.