Score:0

Can't login my webdav built on nginx with right user and password

in flag

I build my webdav server this way:

apt-get install nginx-full
vim /etc/nginx/conf.d/webdav.conf
server {
    listen 80;
    listen [::]:80;
    server_name vps_ip;
    auth_basic              realm_name;
    auth_basic_user_file    /etc/nginx/.credentials.list;
    dav_methods     PUT DELETE MKCOL COPY MOVE;
    dav_ext_methods PROPFIND OPTIONS;
    dav_access      user:rw group:rw all:r;
    client_max_body_size    0;
    create_full_put_path    on;
}
#add username and  password
echo -n 'userName:' | sudo tee -a /etc/nginx/.credentials.list;
openssl passwd -apr1 | sudo tee -a /etc/nginx/.credentials.list;
#restart my nginx
systemlctl restart nginx

Type my vps ip in browser and input username and password, it will pop up the window over and over

enter image description here

How to fix it then?

1.account and password I have set account and password as sammy,sammy.

cat   /etc/nginx/.credentials.list
$apr1$8n9ND3iO$5.vkNPeJZ5h3jJ/d.onJ81

2.log

cat   /var/log/nginx/access.log
xxxx - - [26/Jul/2021:00:26:12 +0000] "GET /.env HTTP/1.1" 401 597 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36"
xxxx - - [26/Jul/2021:00:26:13 +0000] "POST / HTTP/1.1" 401 597 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36"
xxxx - - [26/Jul/2021:00:27:54 +0000] "GET / HTTP/1.1" 400 173 "-" "-"
xxxx - - [26/Jul/2021:00:39:28 +0000] "GET / HTTP/1.1" 401 195 "-" "Mozilla/5.0 (compatible; CensysInspect/1.1; +https://about.censys.io/)"
cat   /var/log/nginx/error.log
#Nothing in  /var/log/nginx
Michael Hampton avatar
cz flag
What is in `/etc/nginx/.credentials.list`?
vidarlo avatar
ar flag
And what does the access log and error log have to say?
Michael Hampton avatar
cz flag
Now you can clearly see that the `/etc/nginx/.credentials.list` is not in the correct format.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.