LowPowerLab Forum

Hardware support => General topics => Topic started by: jeremiah on April 17, 2014, 01:51:31 AM

Title: htpasswd - adding users
Post by: jeremiah on April 17, 2014, 01:51:31 AM
I have been trying to add users to the .htpasswd file with no luck.

Iam using the code shown in the home automation setup post.
sudo echo -e "USERNAME:`perl -le 'print crypt("PASSWORD","SALT")'`" > sudo /var/www/default/.htpasswd


when i put that I do not get an error, it just asks as if it ran. Yet when I use sudo nano to open the file, only the user pi is shown. which is the only login that works when I hit the webpage.

any ideas?
Title: Re: htpasswd - adding users
Post by: Felix on April 17, 2014, 07:56:12 AM
split the command in two parts:

sudo echo -e "USERNAME:`perl -le 'print crypt("PASSWORD","SALT")'`"              -> this will output the generated password to screen, so copy it
sudo nano /var/www/default/.htpasswd                                                              -> now paste the user/password here

Also, google is your friend, almost always ;)