Fix: An Attempt Was Made to Access a Socket in a Way Forbidden by its Access Permissions

The error “An Attempt Was Made to Access a Socket in a Way Forbidden by its Access Permissions” often occurs after a Windows update and disrupts network communication by preventing applications from binding to a specified port.

Users commonly encounter this issue when running the ipconfig/renew command or starting an Apache server. This error signifies that the program is attempting to access a network socket in violation of the operating system’s access permissions.

The most frequent cause is another process occupying the desired port, or security software like firewalls or antivirus programs blocking access. Additional causes may include administrative restrictions or reserved port ranges.

An attempt was made to access a socket in a way forbidden by its access permissions
An attempt was made to access a socket in a way forbidden by its access permissions

Now that we’ve covered the causes behind the “An Attempt Was Made to Access a Socket in a Way Forbidden by its Access Permissions” error, let’s dive into the most effective solutions to resolve it.

Method 1: Disabling Internet Connection Sharing

This one is quite a peculiar culprit because Internet Sharing on Windows uses a few different ranges of ports that aren’t necessarily reported to Netstat or a similar tool.

However, several users reported that for them, the issue was resolved permanently after they disabled Internet Connection Sharing. There are two different ways that will allow you to disable Internet Connection Sharing on Windows. Follow whichever method is more convenient for you:

Disabling Internet Connection Sharing via Control Panel

  1. Press Windows key + R to open up a Run dialog box. Then, type “ncpa.cpl” and press Enter to open up the Network Connections window.
    Run dialog box: ncpa.cpl
    Run dialog box: ncpa.cpl
  2. Inside the Network Connections window, right-click on your active network connection and choose Properties.
    Right-click on your network connection and choose Properties
    Right-click on your network connection and choose Properties
  3. In the Properties screen of your network, go to the Sharing tab and uncheck the box associated with Allow other network users to connect through this computer’s Internet connection.
    Disabling Internet Connection sharing
    Disabling Internet Connection sharing
  4. Restart your computer and see if the error message has been resolved.

Disabling the Internet Connection Sharing Service

  1. Press Windows key + R to open up a Run dialog box. Then, type “services.msc” and press Enter to open up the Services screen.
    Run dialog: services.msc
    Run dialog: services.msc
  2. Inside the Services screen, use the right-hand pane to locate the Internet Connection Sharing (ICS) service. Once you manage to locate it, double-click on it.
  3. In the Internet Connection Sharing (ICS) screen, go to the General tab and change the Startup type to Disabled.
    Setting the Startup type of the ICS to Manual
    Setting the Startup type of the ICS to Manual
  4. Restart your computer and see if the issue has been resolved.

Method 2: Uninstalling your 3rd party AV or whitelisting the connection

A lot of users have pointed out that 3rd party security suites should be checked to confirm they’re not interfering with SMTP connections. McAfee, BitDefender, and Avast are confirmed to block certain ports used by localhost connections. With certain ports, this is standard behavior to prevent mass mail attacks.

You can typically resolve this issue by whitelisting the connection that is being blocked from your AV settings. Keep in mind that the steps to establish a whitelist rule will differ depending on your security solution client.

"In

If you’re having trouble identifying the connection that is being blocked, you can temporarily uninstall your 3rd party antivirus and see if the issue is resolved.

Note: Keep in mind that disabling the real-time protection of your AV will not help you reach a conclusion since the same rules will remain firmly in place.

If you decide to uninstall your 3rd party AV, you can follow this step-by-step guide (here). In the event that this method wasn’t applicable or you’ve determined that the 3rd party client was not responsible for the error, move down to the next method below.

Update: IP blocking clients such as PeerBlock might automatically block an IP that is involved in the operation that is failing. Several users have reported that the issue was automatically resolved after creating a rule exception or uninstalling the IP blocking software.

Method 3: Adding an exclusion to the Windows Firewall

As it turns out, the integrated Windows Firewall can also be responsible for the “an attempt was made to access a socket in a way forbidden by its access permissions” error.

Several affected users reported that they managed to get the issue resolved after allowing the program that is displaying the error to communicate through Windows Firewall. This method is typically reported to be successful with users encountering the error with an SQL server, but you can adapt the steps below to accommodate a different program.

  1. Press Windows key + R to open up a Run dialog box. Next, type “firewall.cpl” and press Enter to open up Windows Defender Firewall.
    Run dialog: firewall.cpl
    Run dialog: firewall.cpl
  2. Inside the Windows Defender Firewall screen, click on Allow an app or feature through Windows Defender Firewall.
    Click on Allow an app or feature through Windows Defender Firewall
    Click on Allow an app or feature through Windows Defender Firewall
  3. Inside the Allowed Apps screen, click on the Change settings button.
    Clickin on Change settings to allow security changes
    Click on Change settings to allow security changes
  4. Look through the list of allowed apps and features and locate the app that is triggering the error. Once you do so, make sure that the Private and Public checkboxes associated with the application in question are enabled.
    Allowing the application on Private and Public networks
    Allowing the application on Private and Public networks

    Note: In the event that you can’t find the program listed under Allowed apps and features, click the Allow another app button and select it manually by clicking on Browse.

    Allowing another app that is not listed
    Allowing another application that is not listed
  5. Once the changes have been made, restart your computer and see if the “an attempt was made to access a socket in a way forbidden by its access permissions” error is resolved at the next startup.

Method 4: Restarting the Internet Information Services (IIS)

Several users have reported that the issue was resolved after they restarted the Internet Information Services (IIS) from an elevated Command Prompt window.

But keep in mind that restarting the IIS servers will drop all internet services including FTP, SMTP, and NNTP, and any data held in the applications handling the connections will be lost.

  1. Press Windows key + R to open up a Run dialog box. Then, type “cmd” and press Ctrl + Shift + Enter to open up an elevated Command Prompt window.
    Run dialog: cmd, then press Ctrl + Shift + Enter
    Run dialog: cmd, then press Ctrl + Shift + Enter
  2. Inside the elevated Command Prompt, type the following command and press Enter to restart the Internet Information Services:
    iisreset
  3. Wait until the Internet services are successfully stopped and restarted, then repeat the same procedure that was triggering the error to see if the issue has been resolved.
    Restarting the Internet Information Services
    Restarting the Internet Information Services

    If you’re still seeing the “an attempt was made to access a socket in a way forbidden by its access permissions” error, move down to the next method below.

Method 5: Using a previous system restore point

After finding that several other repair strategies were ineffective, some users have finally managed to connect to the internet without being blocked by the “an attempt was made to access a socket in a way forbidden by its access permissions” error by reverting their machine state to a previous point in time using System Restore.

If you only started to see this error recently and you’re lucky enough to have a system restore point that is dated before you started struggling with this issue, then the following steps should help you resolve the issue for good:

  1. Press Windows key + R to open up a Run dialog box. Next, type “rstrui” and press Enter to open the System Restore wizard.
    Run dialog: rstrui
    Run dialog: rstrui
  2. At the first screen of System Restore, select Choose a different restore point and click Next.
    Choose a different system restore point
    Choose a different system restore point
  3. At the next screen, start by checking the box associated with Show more restore points. Then, select a system restore point that has an older date than the appearance of the problem and click the Next button again.
    Select a system restore point and click Next
    Select a system restore point and click Next
     
  4. Upon clicking Finish, Windows will automatically restart, and the older state will be restored at the next startup. Once your computer boots back up, see if the issue was resolved.

Method 6: Disconnecting from the VPN network

Some affected users have discovered that in their case, the issue was caused by a VPN client. It turns out that the “an attempt was made to access a socket in a way forbidden by its access permissions” error can also be caused by a VPN client that is causing some involved localhost connections to fail.

To test whether this theory holds in your case, simply disconnect from the VPN network and see if the issue is resolved. If the error message no longer occurs while VPN is disconnected, you need to look for a different VPN client or at least keep it disabled while performing a certain task that will trigger the error.

ABOUT THE AUTHOR

Kevin Arrows


Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.