# Dashboard UI "max try" login

**URL:** <https://discourse.nodered.org/t/dashboard-ui-max-try-login/27349>\
**Category:** Dashboard\
**Created:** [27 May 2020 06:42 UTC](https://discourse.nodered.org/t/dashboard-ui-max-try-login/27349 "2020-05-27T06:42:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![me6ran](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@me6ran](https://discourse.nodered.org/u/me6ran)\
**Post date:** [27 May 2020 06:42 UTC](https://discourse.nodered.org/t/dashboard-ui-max-try-login/27349/1 "2020-05-27T06:42:58Z")

</div>

Hi  
Seems like UI Dashboard does not have a "max try" option for its login,. I have been trying to find a way to limit the login try on my UI Dashboard, but no success.  
for example if I navigate to my UI address http://my\_ip:my\_port/ui, it prompts user/password dialog, and seems like it prompts you infinite times if you put the wrong user/password. how I can limit this number of try to 3 time lets say.

Thanks.

---

<div class="post-metadata">

**Author:** ![meeki007](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/meeki007/32/12499_2.png) [@meeki007](https://discourse.nodered.org/u/meeki007)\
**Post date:** [27 May 2020 20:57 UTC](https://discourse.nodered.org/t/dashboard-ui-max-try-login/27349/2 "2020-05-27T20:57:06Z")

</div>

I use a nginx reverse proxy then fail2ban with a custom filter for 403 Forbidden  
if you enter the wrong details for login node-red will send back 403 Forbidden

I'm not going to cover how to setup a nginx reverse proxy here or installing fail2ban but here is how I setup fail2ban for rejecting failed login attempts and other failed requests on the server.

Create a new fail2ban filter for 404, 444, 403, 400 responses from the server.

```auto
$ sudo nano /etc/fail2ban/filter.d/nginx-4xx.conf

```

add the following to the file

```auto
[Definition]
failregex = ^<HOST>.*"(GET|POST).*" (404|444|403|400) .*$
ignoreregex =

```

exit and save changes to file

```auto
CTRL+x

```

Now, edit your /etc/fail2ban/jail.conf, to use the new filter we created and ban after 3 failed attempts.

```auto
$ sudo nano /etc/fail2ban/jail.conf

```

add/edit the following in the file

```auto
[nginx-4xx]
enabled = true
port = http,https
logpath = %(nginx_access_log)s
maxretry = 3

```

exit and save changes to file

```auto
CTRL+x

```

restart fail2ban

```auto
$ sudo service fail2ban restart

```

check that the new rule is working

```auto
$ sudo fail2ban-client status nginx-4xx

```

now the user will be banned for the amount of time you have set in fail2ban after 3 failed attempts

you can check this is working with the logs.

```auto
$ sudo cat /var/log/fail2ban.log | grep Ban

```

and in nginx

```auto
$ sudo cat /var/log/nginx/access.log

```

---

<div class="post-metadata">

**Author:** ![meeki007](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/meeki007/32/12499_2.png) [@meeki007](https://discourse.nodered.org/u/meeki007)\
**Post date:** [27 May 2020 21:10 UTC](https://discourse.nodered.org/t/dashboard-ui-max-try-login/27349/3 "2020-05-27T21:10:10Z")

</div>

Just checked in on the server as its been a few weeks.  
fail to ban is working just fine.

 ![Screenshot from 2020-05-27 17-06-21](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/3/e3598756a11aea899eff624f005c012be7258c91.png)

Looks like @#@# from china got the msg that its not worth his time  
[https://www.abuseipdb.com/check/115.159.123.29](https://www.abuseipdb.com/check/115.159.123.29)

---

<div class="post-metadata">

**Author:** ![meeki007](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/meeki007/32/12499_2.png) [@meeki007](https://discourse.nodered.org/u/meeki007)\
**Post date:** [27 May 2020 23:58 UTC](https://discourse.nodered.org/t/dashboard-ui-max-try-login/27349/4 "2020-05-27T23:58:48Z")

</div>

Just finished the whole guide if you need more information on fail2ban  
[https://discourse.nodered.org/t/node-red-server-with-nginx-reverse-proxy-howto-guide/27397](https://discourse.nodered.org/t/node-red-server-with-nginx-reverse-proxy-howto-guide/27397)

---

<div class="post-metadata">

**Author:** ![me6ran](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@me6ran](https://discourse.nodered.org/u/me6ran)\
**Post date:** [6 June 2020 20:44 UTC](https://discourse.nodered.org/t/dashboard-ui-max-try-login/27349/6 "2020-06-06T20:44:07Z")

</div>

Thank you for your reply, it adds too much complexity in my system as I am already using ngnix for other purpose. I prefer to remove the whole node-red and start learning Django, rather than dealing with such a complexity.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 June 2020 21:01 UTC](https://discourse.nodered.org/t/dashboard-ui-max-try-login/27349/7 "2020-06-06T21:01:12Z")

</div>

I would have thought that if you already use nginx that the effort of adding a node-red server and fail2ban to it would have been almost trivial.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [6 June 2020 21:02 UTC](https://discourse.nodered.org/t/dashboard-ui-max-try-login/27349/8 "2020-06-06T21:02:38Z")

</div>

@meeki007 nice write up, thanks for taking the time to document.  
I'm sure other users will find it of interest.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 July 2020 21:02 UTC](https://discourse.nodered.org/t/dashboard-ui-max-try-login/27349/9 "2020-07-06T21:02:43Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
