找回sa密码 [英] Recover sa password

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

问题描述

我有一台被另一位员工使用的电脑.

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

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

<块引用>

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

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

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

我可以更改吗?

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

解决方案

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

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

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

你也可以搜索不那么严谨的方法来做到这一点(例如,有些密码破解者我不太愿意分享).

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

我写了一篇关于使用 PSExec 连接到使用 NT AUTHORITY\SYSTEM 帐户(适用于 < SQL Server 2012)的实例,以及展示如何破解 SqlWriter 服务(可以适用于更现代的版本)的后续行动:

以及其他一些资源:

I have a computer which was used by another employee.

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.

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.

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

Can I change it?

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

解决方案

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).

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

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).

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.

I wrote a tip on using PSExec to connect to an instance using the NT AUTHORITY\SYSTEM 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):

And some other resources:

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

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