简体   繁体   English

如何在不添加用户的情况下远程连接到 SQL Server?

[英]How to remotely connect to SQL Server without adding user?

I have 3 machines, one of them is acting like a server that contains the database and tables.我有 3 台机器,其中一台充当包含数据库和表的服务器。 However when I try to connect over the Named Pipes protocol, I need to add a domain account to each machine.但是,当我尝试通过命名管道协议进行连接时,我需要为每台机器添加一个域帐户。

What I want to do is to access the database remotely using the 2 other machines without adding any user;我想要做的是使用另外两台机器远程访问数据库而不添加任何用户; I'm using Windows authentication.我正在使用 Windows 身份验证。

When you use Windows authentication, you need to have the same Windows account on both the machine making the request, and the server.当您使用 Windows 身份验证时,您需要在发出请求的机器和服务器上拥有相同的 Windows 帐户。

To do what you are trying to do, you would need to use SQL Server authentication or user impersonation.要执行您尝试执行的操作,您需要使用 SQL Server 身份验证或用户模拟。 Personally, I find user impersonation to leave too many potential security holes, so I recommend SQL Server authentication.就个人而言,我发现用户模拟会留下太多潜在的安全漏洞,因此我建议使用 SQL Server 身份验证。

Very top level question so very top level answer:非常顶级的问题,所以非常顶级的答案:

Extend and manage permissions by Active Directory groups.按 Active Directory 组扩展和管理权限。 Place individual user's accounts into the active directory groups.将单个用户的帐户放入活动目录组。 You are now managing permissions from an AD perspective and not by a individual machine perspective.您现在正在从 AD 角度而不是从单个机器角度管理权限。 ie user mgmt happens in one place instead of distro.即用户管理发生在一个地方而不是发行版。

This way you are not constantly adding/removing users to multiple machines.这样您就不会不断地向多台机器添加/删除用户。 They are just placed in the group and have access to X number of servers due to permission inheritance.由于权限继承,它们只是被放置在组中并且可以访问 X 台服务器。

It also saves you from hard coding sql account credentials into distributable applications.它还使您免于将 sql 帐户凭据硬编码到可分发的应用程序中。 Not a huge concern if this was a web application but think what would happen if you had the need to cycle your sql user password and you had your wpf application installed on X number of machines...becomes a management/release nightmare如果这是一个 Web 应用程序,这不是一个大问题,但想想如果你需要循环你的 sql 用户密码并且你的 wpf 应用程序安装在 X 台机器上会发生什么......成为管理/发布的噩梦

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM