Hosting a local file to a remote server and password protecting it

  • ssh into the server where you want your files to be hosted.

ssh [Enter your password when prompted]

  • Go to the folder where you want to host the files.
  • Create a .htaccess file and a .htpasswd file.
  • I used vim. Go to this site and create a htpasswd file that is hashed. Basically enter the username and password you want to protect the folder with, and it will give you a string. Copy that string in your .htpasswd file and save it.
  • Copy the following to your .htaccess file

AuthUserFile /home/content/10/9290610/html/appliance_data/.htpasswd
AuthGroupFile /dev/null
AuthName "EnterPassword"
AuthType Basic
require valid-user

  • Go to the source folder directory and secure copy it to the remote server
    scp -rp Source_Folder

5 thoughts on “Hosting a local file to a remote server and password protecting it

    • Thanks for the tip Mario. Also, I uploaded all the folders in the server, and now I am trying to compress them there but it is not letting me zip. Particularly, for the bigger folders that has 200 files each of 200 Mb, after around 10 files it gives “zip error: Interrupted (aborting)” error. Is there a way to fix it ?

Leave a Reply to Mario Bergés Cancel reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>