TMBTC Post

Using SSH To Reach Servers Through Gateways


SSH

Using SSH To Reach Servers Through Gateways

2012-07-06
using-ssh-to-reach-servers-through-gateways
I use SSH a lot and having to log into all of my machines individually and then run a command gets tedious. In many cases I need to go through a gateway machine before accessing my target machine. Here are a few simple methods for running commands from your machine to a target machine.

Simple two hop

This will put you at the command prompt for serverB.
$ ssh -t user@serverA "ssh user@serverB"

Simple three hop

This command will put you at the prompt three hosts into a network on serverC.
$ ssh -t user@serverA "ssh -t user@serverB 'ssh user@serverC'"
You can replace the ssh user@serverC command with another command such as ping targetserverC and you will get the response ping as if you were sitting at serverB executing the ping.
$ ssh -t user@serverA "ssh -t user@serverB 'ping google.com'"
*******************************************************************
user@serverA's password:
*******************************************************************
user@serverB's password:
*******************************************************************
PING google.com (74.125.45.138) 56(84) bytes of data.
64 bytes from serverB (74.125.45.138): icmp_seq=1 ttl=54 time=10.9 ms
64 bytes from serverB (74.125.45.138): icmp_seq=2 ttl=54 time=2.40 ms
64 bytes from serverB (74.125.45.138): icmp_seq=3 ttl=54 time=2.83 ms
--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 15ms
rtt min/avg/max/mdev = 2.154/3.533/10.952/1.935 ms
Good luck!

You might also like
simple-bash-script-to-email-server-status

Simple Bash Script To Email Server Status

2012-08-22

I didn't want to constantly have to log into my servers in order to check on key performance indicators so I decided to write a simple script that would do the checking for me. After collecting results, the script emails them to me. There are a few tools called within the script you might need to install. I also convert any tabs into spaces in order to make sure things line up nicely inside my email. #!/bin/bash SERVER="myserver001" TOEMAIL="admin@myservers.com" FROMEMAIL="myserver001@myserverscom" # Who is logged in and what are they up to WHO=`w` #


Read More...

how-to-fix-pagehandlerfactory-integrated-has-a-bad-module-when-setting-up-asp-net

How to fix: “PageHandlerFactory-Integrated” has a bad module when setting up ASP.NET

2012-08-22

I was recently setting up IIS 7.5 on Windows 2008 R2 for an ASP.NET site and came across the following 500 error: Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list. After a bit of searching, it turns out ASP.NET was not completely installed with IIS even though I checked that box in the "Add Feature" dialog. I found a number of suggestions but found this command. It fixed my issues and got rid of the error. %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i For a 32 bit system, use the


Read More...