Linked server configuration

  • I have user "TestUser" created on two servers S1 and S2 (with different passwords of course). I created S2 as linked server ON S1. So i ran the command sp_addlinkedserver on S1 giving @datasrc as S2. Now when I am trying a query it gives me th error "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'." The user TestUser has read permissions in both server S1 and S2 (and i'm doing a simple read operation).

    Am i missing something ? Should i have to configure the same login TestUser with the help of sp_addlinkedsrvlogin on S1 ? If yes, then what should i keep in mind while creating the login ? Are there any other settings required for this to work ?

  • use the same password on both servers or set up impersonation.

  • Passwords cannot be same. How can the logins be impersonated ?

  • Right-click on the linked server and go to properties. Then go to the security section and click on the ADD button.

    Thanks,

    Jared

    Jared
    CE - Microsoft

  • Thanks. Few more clarifications:

    1. If we use following command on server S1

    EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname = N'S2', @locallogin = N'TestUser', @useself = N'True'

    Here does it means, that password is not required and any query fired from S1 using TestUser credentials will use TestUser of server S2 in S2 ?

    2. Once this impersonation done, can the back query be fired ? Meaning if I want to fire query from S2 to S1 useing TestUser user, will it work ?

  • To answer your first question... I don't know. I use the GUI for this and have never scripted it. You should be able to find the answer by using the GUI, then generating the script for it, then comparing that with BOL.

    Second question, if I understand it correctly, is no. A linked server set up on S1 for S2 will not automatically set up a linked server on S2 for S1.

    Thanks,

    Jared

    Jared
    CE - Microsoft

  • Thanks Jared.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply