Create Web passwords without complexity

Discussions on Python, Bash, Perl, etc.
Post Reply
micklang
Posts: 10
Joined: Wed May 17, 2017 11:27 pm
Location: London, UK
Contact:

Create Web passwords without complexity

Post by micklang » Tue May 23, 2017 10:43 am

Well, we're already authenticated, so why have a complex password just to web browse?

The below script will allow you to create simple (short) passwords to make it easier for you or your users to authenticate via web browser. **Note: this should not be used for external accounts that web browse in.

Launch this at SystemLow after creating new user accounts.

Create this script in /opt/j**x/site-scripts and make executable.

#!/bin/bash

passwdfile="/etc/opt/Apache/passwords"
context=`id -Z | cut -d ':' -f 4`

if [ $context != "SystemLow!" ]; then
echo "You can only run this from a SystemLow terminal."
echo " ";
exit;
fi

echo "Webpass - used to add/change passwords for the Web interface.";
echo " ";
echo "Enter the user's name:";
echo " ";
read username;
echo " ";
echo "Enter the desired password: (note: it cannot be null)";
echo " ";
read password;
echo "Creating password entry for $username...";
echo " ";
/opt/Apache/bin/htpasswd -b $passwdfile $username $password

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest