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

Routing

BGP Communities

BGP Communities has to be one of my favorite features added to the BGP protocol.

2015.02.10 · 4 min
Routing

Cisco MPLS VRF Configuration and Demo

A while back I asked everyone to vote on what topic they wanted to see next, and by no surprise almost every voted for MPLS VRFs.

2009.11.19 · 11 min
Routing

How does latency effect throughput?

One of the questions I get asked several times a week by my clients is as such.

2009.05.07 · 2 min