- ssh into the server where you want your files to be hosted.
ssh firstname.lastname@example.org [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
- Go to the source folder directory and secure copy it to the remote server
scp -rp Source_Folder email@example.com:destination_folder_path