恢复sa密码 [英] Recover sa password

查看:37
本文介绍了恢复sa密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台被其他员工使用的电脑.

I have a computer which was used by another employee.

已安装 SQL Server 2008 R2,但我不知道sa"密码.

SQL Server 2008 R2 was installed but I don't know the 'sa' password.

当我尝试更改登录时,出现以下错误.

When I try to alter the login, it gives below error.

无法更改登录sa",因为它不存在或您没有权限.

Cannot alter the login 'sa', because it does not exist or you do not have permission.

当我尝试恢复数据库时,它给出了不同的权限错误.

When I try to restore a database, it gives a different permission error.

(当我进入安全性 --> 登录 --> sa --> 属性Windows 身份验证已禁用.)

(When I enter the Security --> Logins --> sa --> Properties windows authentication is disabled.)

我可以换吗?

P.S: 密码不是密码":)

P.S: Password is not "password" :)

推荐答案

最好的方法是通过连接域/本地管理员来简单地重置密码(因此您可能需要系统管理员的帮助),但这仅适用如果 SQL Server 设置为允许本地管理员(这些现在在设置过程中被排除在默认管理员组之外).

The best way is to simply reset the password by connecting with a domain/local admin (so you may need help from your system administrators), but this only works if SQL Server was set up to allow local admins (these are now left off the default admin group during setup).

如果您无法使用此方法或其他现有方法来恢复/重置 SA 密码,此处解释了其中的一些方法:

If you can't use this or other existing methods to recover / reset the SA password, some of which are explained here:

然后您可以随时备份重要数据库、卸载 SQL Server 并安装新实例.

Then you could always backup your important databases, uninstall SQL Server, and install a fresh instance.

您也可以搜索不那么严格的方法来做到这一点(例如,我不热衷于分享密码破解程序).

You can also search for less scrupulous ways to do it (e.g. there are password crackers that I am not enthusiastic about sharing).

顺便说一句,sa 的登录属性永远不会说 Windows 身份验证.这是设计使然,因为这是一个 SQL 身份验证帐户.这并不意味着在实例级别禁用了 Windows 身份验证(实际上不可能这样做),只是没有申请 SQL 身份验证帐户.

As an aside, the login properties for sa would never say Windows Authentication. This is by design as this is a SQL Authentication account. This does not mean that Windows Authentication is disabled at the instance level (in fact it is not possible to do so), it just doesn't apply for a SQL auth account.

我写了一篇关于使用 PSExec 连接到使用 NT AUTHORITYSYSTEM 帐户的实例(适用于 < SQL Server 2012),以及后续说明如何破解 SqlWriter 服务(可在更现代的版本上运行):

I wrote a tip on using PSExec to connect to an instance using the NT AUTHORITYSYSTEM account (which works < SQL Server 2012), and a follow-up that shows how to hack the SqlWriter service (which can work on more modern versions):

还有其他一些资源:

利用服务 SID 登录到具有系统管理员权限的 SQL Server 实例

这篇关于恢复sa密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆