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

Some users reported receiving the “an attempt was made to access a socket in a way forbidden by its access permissions” error when trying to run the ipconfig/renew command in CMD in order to repair their network connection. Other users report that this issue is occurring when they try to start an Apache server. However, almost all affected users report that the issue started occurring after a Windows automatic update has been installed.

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

What is causing the attempt was made to access a socket in a way forbidden by its access permissions error?

We investigated this particular issue by looking at various user reports and the repair strategies that they used to get the issue resolved. From what we gathered, there are several different scenarios that will trigger the apparition of this issue:

  • VPN client is blocking the involved localhost connections – Several users have discovered that in their case, the culprit responsible for the issue was their VPN client. Disabling the VPN client resolved the issue for most affected users.
  • 3rd party firewall is blocking the connection – If you have an external firewall, it could be responsible for blocking your SMTP connections. Most of the time, McAfee Anti-Virus and Avast are confirmed as culprits.
  • The application is trying to open a port that is already used – One of the most common reasons why this error occurs is if you try to use an application that is configured to open a port that is already opened and actively used by a different service or application.
  • Windows 10 security feature – Starting with Windows 10, Microsoft has implemented a new security feature that will prevent users from grabbing a random port and giving it away to some service. This could occur if you’re using a script or a home brewed application.
  • Another process is listening on the desired port – Conflicts like this are known to happen quite frequently when trying to start instances of Apache Web Server or when trying to access an SQL server on Hostgator remotely.

If you’re currently struggling to resolve the issue, this article will provide you with a list of verified steps that other users in a similar situation have used to get the issue resolved. Below you have several methods that other users encountering the same error message have used to fix the problem.

For the best results, follow the potential fixes below in order until you encounter one that is effective for your particular scenario.

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 methods are more convenable 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 on.
  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 suits should be checked to confirm that they’re not interfering with the SMTP connections. McAfee, BitDefender, and Avast are confirmed to blocked certain ports used by localhost connections. With certain ports, this is standard behavior in order to prevent mas mail attacks.

As some users have reported, an overprotective firewall or a similar security filtering tool can be responsible for causing the “an attempt was made to access a socket in a way forbidden by its access permissions” error.

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

In Avast, you can add a connection to the exclusion by going to Settings srcset=
General> Exclusion.” width=”789″ height=”534″> In Avast, you can add a connection to the exclusion by going to Settings > General > Exclusion.

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 SQL server, but you can adapt the steps below to accommodate a different program.

Here’s a quick guide with what you need to do:

  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 questions 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.

If you’re still seeing the same error, move down to the next method below.

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 is lost.

Here’s a quick guide on how to do this:

  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 where 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 these 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 the 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 apparition on 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 true in your case, simply disconnect from the VPN network and see if the issue is resolved. If the error message is no longer occurring 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.