Thursday, August 6, 2009

401.1 Error When Accessing SharePoint From Server

If you are running SharePoint Server 2007 or WSS 3.0 on  Windows Server 2003 SP1 or later you will run into authentication issues if you are trying to access a SharePoint site using host headers from the server itself (i.e. host file has portal.mydomain.com pointed to 127.0.0.1).  This issue manifests itself as the result of a loop back security check that Microsoft built in to Windows Server 2003 SP1 and later.  The purpose of the loopback check is to eliminate denial of service attacks however it causes issues with access SharePoint sites locally from the server.  In a typical production environment this is typically not a problem since you rarely access SharePoint sites (besides central admin) from  a front end web server itself.

You can read the detailed KB article at http://support.microsoft.com/kb/926642 & http://support.microsoft.com/kb/896861.

Here is a rundown of how to fix the problem.   I typically disable the loopback check in development scenarios; however, this is not recommended for production server environments.

Method 1: Disable the authentication loopback check
Re-enable the behavior that exists in Windows Server 2003 by setting the DisableLoopbackCheck registry entry in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa registry subkey to 1. To set the DisableLoopbackCheck registry entry to 1, follow these steps on the client computer:

1. Click Start, click Run, type regedit, and then click OK. 

2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa

3. Right-click Lsa, point to New, and then click DWORD Value. 

4. Type DisableLoopbackCheck, and then press ENTER. 

5. Right-click DisableLoopbackCheck, and then click Modify.

6. In the Value data box, type 1, and then click OK. 

7. Exit Registry Editor.

8. Restart the computer.

Note: You must restart the server for this change to take effect. By default, loopback check functionality is turned on in Windows Server 2003 SP1, and the DisableLoopbackCheck registry entry is set to 0 (zero). The security is reduced when you disable the authentication loopback check, and you open the Windows Server 2003 server for man-in-the-middle (MITM) attacks on NTLM.

Method 2: Create the Local Security Authority host names that can be referenced in an NTLM authentication request
To do this, follow these steps for all the nodes on the client computer:

1. Click Start, click Run, type regedit, and then click OK. 

2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0

3. Right-click MSV1_0, point to New, and then click Multi-String Value

4. In the Name column, type BackConnectionHostNames, and then press ENTER. 

5. Right-click BackConnectionHostNames, and then click Modify. 

6. In the Value data box, type the CNAME or the DNS alias, that is used for the local shares on the computer, and then click OK.

Note: Type each host name on a separate line.

Note: If the BackConnectionHostNames registry entry exists as a REG_DWORD type, you have to delete the BackConnectionHostNames registry entry.

7. Exit Registry Editor, and then restart the computer.