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

2016.09.02 Automation & Tools 3 min read

5 important reasons you should learn scripting

Today’s IT landscape if full of software defined marketecture, and lore of a dystopian future full of network engineers that do nothing but write code.

2010.04.20 Security 2 min read

Poor man's VPN connection

Have you ever needed to access a site that had an IP restriction, or one inside your remote network?