简体   繁体   English

SQL Server 2008中的登录和凭证有什么区别?

[英]What is the difference between login and credential in SQL server 2008?

I am a bit confused SQL server windows login and credential. 我有点困惑SQL服务器Windows登录和凭证。 On books online, it says that credential can access resources beyond sql server, but as far as i see windows login might be able to do that that since it is mapped to a windows user. 在线书籍上,它说凭证可以访问sql server之外的资源,但据我所知,Windows登录可能能够做到这一点,因为它映射到Windows用户。 Am i missing something else? 我错过了别的什么吗?

Thanks, in advance. 提前致谢。

Login: A login is any principal that is granted access to a SQL Server instance. 登录:登录是被授予访问SQL Server实例的任何主体。 The access can be granted to domain users, domain group, or SQL Server authenticated accounts. 可以向域用户,域组或SQL Server身份验证帐户授予访问权限。

Credential: A credential provides a mechanism to store login information for a domain account within SQL Server. 凭据:凭据提供了一种机制,用于存储SQL Server中域帐户的登录信息。 The credential can then be used to pass that authentication information from into another login or a proxy to grant it permissions to resources external to SQL Server. 然后,可以使用凭证将该身份验证信息传递到另一个登录名或代理,以授予其对SQL Server外部资源的权限。

.....use of Login if you need to login and access a SQL Server instance, you'll just use a login. .....如果您需要登录并访问SQL Server实例,请使用登录,您只需使用登录即可。 Regardless of your needs, if you need to get in and do work, the login is through route to go. 无论您的需求是什么,如果您需要进入并开展工作,登录都是通过路线进行的。 The other two won't help you out at all. 其他两个根本不会帮助你。

Use of credentials .. Credentials get brought in when permissions from domain users need to be granted to accounts or services that wouldn't usually have those permissions. 使用凭据 。当域用户的权限需要授予通常不具有这些权限的帐户或服务时,会引入凭据 For instance, if an assembly required EXTERNAL_ACCESS, those permissions could be granted through the use of a credential. 例如,如果程序集需要EXTERNAL_ACCESS,则可以通过使用凭据授予这些权限。 Credentials can also be used to grant SQL Authentication accounts access to external resources. 凭据还可用于授予SQL身份验证帐户对外部资源的访问权限。

A credential is a record containing the authentication information needed to connect to a resource outside of SQL Server. 凭证是包含连接到SQL Server外部资源所需的身份验证信息的记录。 Most credentials consist of a Windows login name and password. 大多数凭据由Windows登录名和密码组成。 On Microsoft Windows Server 2003 and later, the password may not be required. 在Microsoft Windows Server 2003和更高版本中,可能不需要密码。

A single credential can be mapped to multiple SQL Server logins. 单个凭据可以映射到多个SQL Server登录。 But a SQL Server login can be mapped to only one credential. 但SQL Server登录只能映射到一个凭据。

Only users with ALTER ANY CREDENTIAL permission can create or modify a credential. 只有具有ALTER ANY CREDENTIAL权限的用户才能创建或修改凭证。

In previous versions of SQL Server, if there was a need to access something outside of SQL Server the service account under which the SQL Server service was running was the credential that was used. 在以前版本的SQL Server中,如果需要访问SQL Server外部的某些内容,则运行SQL Server服务的服务帐户是使用的凭据。 By specifying a credential you can say if user X runs a stored procedure or query which access resource Y, use credential Z as the account to access it. 通过指定凭证,您可以说用户X是否运行存储过程或查询访问资源Y,使用凭证Z作为帐户来访问它。

@Remus Rusanu You are confusing the idea of a SQL Server login, which is created using CREATE LOGIN, with a different concept called a credential, created with CREATE CREDENTIAL. @Remus Rusanu您对使用CREATE LOGIN创建的SQL Server登录的想法感到困惑,该登录使用CREATE CREDENTIAL创建的称为凭证的不同概念。 See http://www.replicationanswers.com/Security2005.asp for more details. 有关详细信息,请参阅http://www.replicationanswers.com/Security2005.asp

Credentials are needs to cover the case when the login is actually not a Windows user. 当登录实际上不是 Windows用户时,凭据需要涵盖案例。 Typical case being a SQL Login (user authenticated with SQL authentication instead of integrated authentication). 典型情况是SQL登录(用户通过SQL身份验证而不是集成身份验证进行身份验证)。

A credential can also be used to allow SQL Server to access a Windows Azure Blob Storage account. 凭证还可用于允许SQL Server访问Windows Azure Blob存储帐户。 In this case, instead of storing a Windows login name and password, the credential would store the Azure storage account name as well as the storage account access key. 在这种情况下,凭据将存储Azure存储帐户名称以及存储帐户访问密钥,而不是存储Windows登录名和密码。

More details here: https://msdn.microsoft.com/en-us/library/jj720554(v=sql.120).aspx 更多细节在这里: https//msdn.microsoft.com/en-us/library/jj720554(v = sql.120).aspx

Or here: https://msdn.microsoft.com/en-us/library/dn466435(v=sql.120).aspx 或者在这里: https//msdn.microsoft.com/en-us/library/dn466435(v = sql.120).aspx

This is handy if you want to backup or restore a database from an Azure blob container. 如果要从Azure blob容器备份或还原数据库,这很方便。

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

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