Posts How I fixed the error 'an attempt was made to access a socket in a way forbidden by its access permissions' on my machine
Post
Cancel

How I fixed the error 'an attempt was made to access a socket in a way forbidden by its access permissions' on my machine

In the last two days i was fighting the werid situation where i couldn’t bind to a specific port on my machine. All the other ports were fine, but this specific one was just blocked and didn’t matter what applicaiton i ran to try to bind to it.

Here are the steps i did until i found the reason:

  1. make sure it’s not the antivirus or any other security application
  2. make sure no other process is using this port by running netstat or TCPView
    1
    
    netstat -ano | wsl grep "<port>"
    
  3. if anything shows up, kill the process that owns the port
    1
    
    kill <PID>
    
  4. if this didn’t work, reset the machine TCP/IP stack
    1
    
    netsh int ip reset
    
  5. if you find that anything is was blocked and the message “Access is denied” is shown, follow the steps listed here and run the previous step again
  6. Reset the machine
This post is licensed under CC BY 4.0 by Tamir Dresher.

Contents

Trending Tags