Showing posts with label password. Show all posts
Showing posts with label password. Show all posts

Thursday, March 8, 2012

ALTER MASTER KEY REGENERATE Command

Hi,
If I forgot what was the password used to create the Database Master key, I
could just use this command to regenerate a new one:
ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = 'newpassword'
Then what is the use of the following command which requires me to provide a
password?
IF NOT EXISTS (SELECT * FROM sys.symmetric_keys WHERE symmetric_key_id = 101
)
CREATE MASTER KEY
ENCRYPTION BY PASSWORD =
'23987hxJKL969#ghf0%94467GRkjg5k3fd117r$
$#1946kcj$n44nhdlj'
Does this means that the Sys Admin (SA) will have divine rights to
regenerate the Database Master key without the need to know the original
password used to create the key?
Is there any proper guidelines as to how secure a database using the SQL
Server 2005 encryption capability?The database master key (DbMK) has an encryption by password and by default
it also has an encryption by the service master key (SMK). The latter
encryption allows a sysadmin easy access to any data encrypted by the SMK,
whether he knows the password or not. However, if you drop the SMK
encryption (ALTER MASTER KEY DROP ENCRYPTION BY SERVICE MASTER KEY), then
the DbMK can only be used by people that know the DbMK password. The ALTER
statement that you mentioned below can be used by a sysadmin only if the
DbMK has a SMK encryption; otherwise, the sysadmin would need to know the
DbMK password to open the DbMK first, before he could execute the statement.
Note that using a password encryption for the DbMK doesn't really mean that
you lock out the sysadmin from accessing the data - it's just that he
doesn't have direct SQL Server access to the DbMK anymore. For example, in
most cases, a sysadmin is also a local administrator, so he could simply
debug the server process to get the DbMK password at the moment you execute
the OPEN MASTER KEY statement.
Thanks
Laurentiu Cristofor [MSFT]
Software Development Engineer
SQL Server Engine
http://blogs.msdn.com/lcris/
This posting is provided "AS IS" with no warranties, and confers no rights.
"et_ck" <etck@.discussions.microsoft.com> wrote in message
news:7BD34F69-AF85-4057-9341-6E117B4FD532@.microsoft.com...
> Hi,
> If I forgot what was the password used to create the Database Master key,
> I
> could just use this command to regenerate a new one:
> ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = 'newpassword'
> Then what is the use of the following command which requires me to provide
> a
> password?
> IF NOT EXISTS (SELECT * FROM sys.symmetric_keys WHERE symmetric_key_id =
> 101)
> CREATE MASTER KEY
> ENCRYPTION BY PASSWORD =
> '23987hxJKL969#ghf0%94467GRkjg5k3fd117r$
$#1946kcj$n44nhdlj'
> Does this means that the Sys Admin (SA) will have divine rights to
> regenerate the Database Master key without the need to know the original
> password used to create the key?
> Is there any proper guidelines as to how secure a database using the SQL
> Server 2005 encryption capability?
>

alter login problem with sp_executesql

Hi,
I've got a problem with new SQL Server 2005 T-SQL command alter login:
> alter login [LoginName] with password = 'NewPassword' works fine.
> exec sp_executesql N'alter login [LoginName] with password = @.P1', N'@.P1 nvarc
har(128)', N'NewPassword' does not work.
I get this error while executing an ADO 2.8 ADODB.Command with Parameters.
The .CommandText = "alter login [" & Login & "] with password = ?" seems
to
be executed as exec sp_executesql ... (see Profiler).
sp_password works fine, but BOL says not to use sp_password in new
applications.
Can anybody help, please?ALTER LOGIN doesn't accept variables so you can't parameterize the
statement. Is your intention to allow the current user to change their
password? In that case, you can specify the old/new password in the
connection string using the SQLNCLI provider:
"Provider=SQLNCLI;Data Source=MyServer;User ID=MyLogin;Old
Password=oldpassword;Password=newpasswor
d"
Hope this helps.
Dan Guzman
SQL Server MVP
"migeold" <migeold@.discussions.microsoft.com> wrote in message
news:418664FA-F9B0-4C82-8A17-A4D786C741B1@.microsoft.com...
> Hi,
> I've got a problem with new SQL Server 2005 T-SQL command alter login:
> I get this error while executing an ADO 2.8 ADODB.Command with Parameters.
> The .CommandText = "alter login [" & Login & "] with password = ?" see
ms
> to
> be executed as exec sp_executesql ... (see Profiler).
> sp_password works fine, but BOL says not to use sp_password in new
> applications.
> Can anybody help, please?

Sunday, February 19, 2012

Allowing SQL Users to change password

Hi guys,

Is there anyway to allow SQL Server users to change their own passwords without giving them rights to "db_securityadmin" ?

Our M$ adviser suggested creating our own app using SQL NS and DMO to do it.

Is there any easier method, reference, download sample from the web?from qa:

sp_password 'oldpassword', 'newpassword'|||Without giving them sysadmin or securityadmin , is it possible?
I mean ..just changing their own password...
I wrote this:
EXEC sp_password '123', '456', 'test1'

I got this error:

"Only members of the sysadmin role can use the loginame option. The password was not changed."

But I read this in Books Online, can't really understand it yet...:
Permissions
Execute permissions default to the public role for a user changing the password for his or her own login. Members of the securityadmin and sysadmin fixed server roles can change the password for another user's login.|||woppps...of course...just exclude the loginname...sorry bout that...
okay ..thanks..it works!

EXEC sp_password '123', '456'