#!/bin/bash read -p "Enter username: " -r ht_username read -p "Enter password: " -sr ht_password echo -en "\n" read -p "Enter full path to where .htpasswd will be placed on the web server: " -r ht_path htpasswd -nb $ht_username $ht_password > .htpasswd echo "AuthType Basic AuthName \"Log in\" AuthUserFile $ht_path Require valid-user" > .htaccess echo " .htaccess / .htpasswd files created in $PWD Username: $ht_username Path: $ht_path "