2
votes

I added an htpasswd.txt to sites-avaiable/default to protect my site:

server {
        auth_basic "closed site";
        auth_basic_user_file /tmp/.htpasswd.txt;

        listen 81 default_server;
        listen [::]:80 default_server ipv6only=on;

        root /var/www/path/to/root
        index index.html index.htm;

        server_name ipaddress;

Now that i'm trying to remove it, I can't get rid of a .htpasswd protection I set up previously. I've tried everything from creating .htaccess in the root of my site with satisfy any like this post suggests and this, to deleting the reference to htpasswd.txt from my sites-available/default file, to reinstalling nginx. I can't find where this htpasswd file is being referenced somewhere from because nothing seems to get rid of it. Lastly I tried deleted the htpasswd.txt file and that just broke the login.

I want the whole site to be available with no htpasswd.

I also did a grep search to find out if the htpasswd file is being called for and it's no where to be found. What can I do?

3
I should add that I also tried deleted the htpasswd file and it's reference in the server blockStackwhoyouknow
You already asked this question here.Mike Rockétt
@mikerockett yes I did. Still haven't found an answer and am getting no responses. Any ideas?Stackwhoyouknow
That doesn't mean that you should ask it again. If there are no responses, it means that those who have viewed it are unable to help you. Per this recommendation, I'm afraid I'm going to have vote to close this as a duplicate. I can only recommend that you add the additional information (such as your code) from this question to the original question.Mike Rockétt
No problem. Feel free to assist if you can. @mikerockettStackwhoyouknow

3 Answers

1
votes

My suggestion to anyone with a problem such as this involving unknowns that cannot be dealt with after much effort: Go to your Server (in my case digital ocean) and create a new (take a snapshot of your server to apply to your new IP) IP / droplet for your site. Uninstall your server engine (Nginx or Apache) and reinstall on the new server / IP. It's a little annoying but at least you wont be stuck like I was for days. Thats how I fixed it. Also, don't despair, you'll figure it out.

0
votes

That file is a hidden file within the /tmp directory to view all hidden files in that directory go to:

/tmp

Then do the command

ls -al

This will show all hidden files in that folder along with permissions.

To remove that file do:

rm -rf .htpasswd.txt

The little . in front of a file means that it is a hidden file and the flag to view hidden files is ls -a

Hope that helps

0
votes

Your browser is most likely caching the required auth. Try a different browser or clear your browser cache.