# Problems to open port 162 (SNMP-TRAP)

**URL:** <https://discourse.nodered.org/t/problems-to-open-port-162-snmp-trap/31555>\
**Category:** General\
**Created:** [14 August 2020 10:09 UTC](https://discourse.nodered.org/t/problems-to-open-port-162-snmp-trap/31555 "2020-08-14T10:09:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fernandezjm](https://avatars.discourse-cdn.com/v4/letter/f/9f8e36/32.png) [@fernandezjm](https://discourse.nodered.org/u/fernandezjm)\
**Post date:** [14 August 2020 10:09 UTC](https://discourse.nodered.org/t/problems-to-open-port-162-snmp-trap/31555/1 "2020-08-14T10:09:50Z")

</div>

I want to use node-red-contrib-snmp-trap-listener to receive traps via snmp, on port 162, but I get this error "can't open port: 162". I have the same problem with node-red-contrib-syslog, which uses port 514. I have read that only the root user can open privileged ports (1-1024).

Is there any way for node-red to open privileged ports without error?

Best regards

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [14 August 2020 10:32 UTC](https://discourse.nodered.org/t/problems-to-open-port-162-snmp-trap/31555/2 "2020-08-14T10:32:01Z")

</div>

Hi @fernandezjm, welcome to the forum.  
This question is not really node-red specific and has been asked and answered many times (a quick search would reveal that).

So, you are right in that on linux, ports 1 - 1024 are privileged. The best way is to permit regular user/process to bind the port without sudo

Here are a few posts that might help...

> [@Node Red on Port 80](https://discourse.nodered.org/t/node-red-on-port-80/2211/5):
>
> So to follow that link then sudo setcap 'cap\_net\_bind\_service=+ep' $(eval readlink -f `which node`) should do it (for Linux) - sets the node.js executable to be able to do this. To follow up on the running as root... while probably not the end of the world on small single user systems it generally considered a bad thing to run services that are quite as powerful as Node-RED as root as they could be corrupted and wipe disks, install bad apps, etc as they have full admin rights to the machine.…

> <https://serverfault.com/questions/112795/how-to-run-a-server-on-port-80-as-a-normal-user-on-linux>

> <https://stackoverflow.com/questions/413807/is-there-a-way-for-non-root-processes-to-bind-to-privileged-ports-on-linux>

---

<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:** [13 October 2020 10:32 UTC](https://discourse.nodered.org/t/problems-to-open-port-162-snmp-trap/31555/3 "2020-10-13T10:32:01Z")

</div>

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