Remote File Sharing : A One-Command HTTPS Server Solution for SSH Users

Do you often need to quickly retrieve output files from scripts executed over SSH?

Something like this if you have the file name in the clipboard:

Or even like this if you don’t have it:

With the following features:

  • Secure file sharing over HTTPS
  • Option to specify a custom port or use a random port
  • Automatic IP address detection
  • SSL certificate generation for secure connections
  • Port availability check and handling
  • Option to temporarily open closed ports (with firewall management)
  • Support for multiple firewall types (ufw, firewall-cmd, iptables)
  • Handling of ports already in use (with option to kill existing processes)
  • File existence check before sharing
  • Python 3 and ‘chardet’ module dependency checks
  • Automatic installation of ‘chardet’ module if missing
  • Display of download instructions for users (using curl or wget)
  • Option to download the SSL certificate for secure connections
  • Simple web interface showing the shared file
  • Automatic encoding detection for text files
  • Support for sharing both text and binary files
  • Error handling for invalid options and file not found scenarios
  • Interactive prompts for user input when needed
  • Display of both secure (with certificate) and insecure (ignoring SSL warnings) download methods

How to install it ?

Put the code bellow in the .bashrc file for instance to get the most useful alias in the world.

The code is available here.

chevron_left
chevron_right

Leave a comment

Your email address will not be published. Required fields are marked *

Comment
Name
Email
Website