How to view files over SSH using SimpleHTTPServer

It is convenient to connect to a remote computer using SSH and work at the shell. But viewing images files and other such common files can be a problem. Using a X server might not always be possible. A simple solution that works for me is to use the SimpleHTTPServer module that ships in Python.

  • Change to the directory which holds the files you want to view from a remote computer.
  • Run the SimpleHTTPServer there and provide a port number for the server:
$ python -m SimpleHTTPServer 8901
  • On the local computer, open a browser and connect to the server using the address: http://put-remote-computer-ip-here:8901
  • You can now view image files and other common file types right in the browser.

Tried with: Ubuntu 18.04

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.