A little helper script which comes handy when you're dealing with lots of ssh connections to many different servers on daily basis.
So instead of typing: ssh [email protected]
You can type (for example): sshort.py panda
Basically, sshort is a wrapper around ssh binary which makes executing ssh connections a bit easier and faster.
Creating a new sshort connection: sshort.py -s name -t [email protected]
Executing a connection: sshort.py name
Creating a connection with optional ssh arguments: sshort.py -s name -t [email protected] -p "-p 1234"
Which is an equivalent of: ssh -p 1234 [email protected]
Removing sshort connection: sshort.py -r name
Listing all stored connections: sshort.py -l
Exporting all stored connections to format directly pluggable into ~/.ssh/config (outputs to STDOUT): sshort.py -x
Exporting single connection to ~/.ssh/config format: sshort.py -e name
Getting help: sshort.py -h
Connections are stored in $HOME/.sshort file by default in following, pipe-separated format: name|[email protected]|-p 1234
This script seems dead simple but is really my very first, usable Python program which I wrote having >5 years of PHP experience. In fact, I wrote sshort with PHP first and have been using on my local machine for ages, so I thought porting it to Python would be nice learning exercise. :)
Lots of PHP influence in first code commits is more than expected. Comments and improvement suggestions are welcome. Thanks!
Dawid Lorenz, dawid-at-lorenz-dot-co