Warning: count(): Parameter must be an array or an object that implements Countable in /home/whatac6/public_html/wp-includes/post-template.php on line 284

Warning: count(): Parameter must be an array or an object that implements Countable in /home/whatac6/public_html/wp-includes/post-template.php on line 284

Warning: count(): Parameter must be an array or an object that implements Countable in /home/whatac6/public_html/wp-includes/post-template.php on line 284

Warning: count(): Parameter must be an array or an object that implements Countable in /home/whatac6/public_html/wp-includes/post-template.php on line 284

Python for the locked down Linux box.

By Sully 3/29/14

So there you are.  Your linux box is locked down in the middle of a firewall battlefield.  Production is down because program alpha is broken. Support wants a log file sent in.    The only ports you have open are specific to secure telnet and the broken service itself.  A simple option, Python.  Python is a simple and rich programming suite that also has some pretty powerful tools.  Most Linux distributions come with it installed standard.

The command that I use most often as a support admin is python -m SimpleHTTPServer 9090.  This will start a simple web serve on port 9090 that displays the folder it was started from.  In this case /tmp/mydir.

 shell

You can use any port you like.  In this example I stopped the application first because the port is already open on the firewall meaning no late night firewall admin call required.  Simply load a web browser using https://serverip:9090 and download any file in the directory you need.

 web

Control-C back in the Linux shell to kill python’s web server and you can get back to surfing.

You can leave a response, or trackback from your own site.

Leave a Reply

%d bloggers like this: