skip to Main Content

When I run an AWS EC2 instance node server port number 25, I’m getting:

Error: listen EACCES: permission denied 0.0.0.0:25

I’m trying to enable sudo users command but not working for me.

May I know any possible way to fix this issue?

2

Answers


  1. The error you’re encountering, Error: listen EACCES: permission denied 0.0.0.0:25, typically occurs when your application tries to bind to a low-numbered port (below 1024), which on most Unix-like systems (including Linux distributions used by AWS EC2 instances) requires administrative (root) privileges.

    I would suggest to change the Port, If you do not specifically need to use port 25 (commonly used for SMTP), consider using a higher-numbered port that does not require elevated privileges.

    Login or Signup to reply.
  2. From Remove port 25 restriction from an EC2 instance | AWS re:Post:

    By default, Amazon EC2 throttles instances on port 25 as a spam prevention measure. AWS blocks outbound traffic on port 25 (SMTP) of all EC2 instances and Lambda functions on elastic network interfaces owned by any account that isn’t allow listed. AWS blocks this traffic to prevent damage to AWS IP reputation and to keep legitimate traffic from being marked as spam. For more information, see Restriction on email sent using port 25.

    You can request that the restriction be removed, but the easiest method is to use a different port on your email server.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search