Password protected Clutch

Some may find the need to manage or control their transmission downloads from the Internet and yet wish to restrict the Clutch web user interface to a handful of authenticated users. This section will guide you through the process of securing your Clutch interface with username and password.

Before you continue, you should have already set up transmission for your DNS-313 or DNS-323 as well as the Clutch web user interface.

Constructing the password generator

Create a htdigest.sh file at /mnt/HD_a2/ with the following content. Simply type vi /mnt/HD_a2/htdigest.sh, press i and paste the following text in.

After pasting in the above text, press <Esc>, then followed by :wq and Enter to save the file.

If you did it correctly, you should end up with a htdigest.sh file at /mnt/HD_a2/.

Generating hash information for username and password

In this case, we will be generating the necessary information for the username “clutch” with password “password” in the realm “Password Protected Area”. Generate the hash information by using the following command.

/ # sh /mnt/HD_a2/htdigest.sh ‘clutch’ ‘Password Protected Area’ ‘password’

clutch:Password Protected Area:98616824633db75cb8d3a63d5c0658cb

Storing the generated hash information

We will store the generated hash information at /ffp/etc/lighttpdpassword

/ # echo “clutch:Password Protected Area:98616824633db75cb8d3a63d5c0658cb” >> /ffp/etc/lighttpdpassword

Turning on authentication on your lighttpd

Enable mod_auth in the server.modules chunk by removing the # at the start of the line.

After the section on server.modules, add the following text:

Save the file.

Testing your work

Restart your lighttpd so that your new settings could be applied.

/ # sh /ffp/start/lighttpd.sh restart
Stopping lighttpd
Starting /ffp/sbin/lighttpd -f /ffp/etc/lighttpd.conf
/ #

Surf to http://<NAS’s ip>:8080/clutch/ and it should prompt your for your username and password.

 

Extra Information

Adding additional users
We can easily add another user “clutch2” with password “password2” in the same realm “Password Protected Area” by generating the hash information and adding to “/ffp/etc/lighttpdpassword”. You would need to reflect this addition by modifying the lighttpd configuration file (/ffp/etc/lighttpd.conf).

Restart your lighttpd for it to recognize the new configuration with the following command

/ # sh /ffp/start/lighttpd.sh restart

You can add more users by repeating the process.

 

Treat shadowandy!

If these step-by-step guides have been very helpful to you and saved you a lot of time, please consider treating shadowandy to a cup of Starbucks.  

  • dotcom

    Thanx for guide works great!

  • cheongseeker

    Hi andy,

    It’s me again. The above guide works great but it’s for one user name and password only. Can it be set to have multiple user names and passwords?

    Thanks.

  • shadowandy

    cheongseeker,

    I’ve updated the guide to reflect how you can add additional users to the same realm.

  • cheongseeker

    Hi andy,

    Thanks for the quick update. I followed the guide but it didn’t work. I edited the lighttpd.conf to include the additional user. Then went to create the hash information in the lighttpdpassword file.

    I even take a look in the lighttpdpassword file and confirm that the second user and password hash information is there.

    However, I cannot logon with the 2nd username and password. It is only possible to logon with the 1st username and password.

    Not sure where I had gone wrong.

  • cheongseeker

    Hi andy,

    I found out my mistake. I didn’t look carefully at the code. I added “require” => “user=clutch|clutch2”

    instead of

    “require” => “user=clutch|user=clutch2”

    Now it is working. Great.

    Thanks a lot.

  • shadowandy

    cheongseeker,

    Glad that it is working fine for you. You could look up the help for lighttpd to see the other configurable functions.

Close