Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Minimum Permissions for sp_adduser

 
   Database Help (Home) -> Security RSS
Next:  Strange question regarding relationships and data..  
Author Message
Munish Narula

External


Since: Mar 12, 2008
Posts: 10



(Msg. 1) Posted: Wed Dec 17, 2008 12:16 pm
Post subject: Minimum Permissions for sp_adduser
Archived from groups: microsoft>public>sqlserver>security (more info?)

I am trying to create a new user who has the permission to create a new user
in SQL 2000. I have greated him only the rights for excuting sp_adduser. But
still this user is not able to create any other user. Is this not suffient
privilege?

What are the minimum set of privilleges required for a user to execute
sp_adduser. I am talking only about SQL 2000 here.

 >> Stay informed about: Minimum Permissions for sp_adduser 
Back to top
Login to vote
Russell Fields

External


Since: Jan 10, 2008
Posts: 608



(Msg. 2) Posted: Wed Dec 17, 2008 4:37 pm
Post subject: Re: Minimum Permissions for sp_adduser [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Munish

From the BOL: "Only the dbo and members of the sysadmin fixed server role
can execute sp_adduser." (I assume that dbo includes members of the
db_owner role, but I have not tested this today.)

So, within a database a dbo can add users, but granting execute on the
stored procedure will not add the rights to a non-dbo. (And, of course,
adding logins is higher rights.)

RLF

"Munish Narula" wrote in message

>I am trying to create a new user who has the permission to create a new
>user
> in SQL 2000. I have greated him only the rights for excuting sp_adduser.
> But
> still this user is not able to create any other user. Is this not suffient
> privilege?
>
> What are the minimum set of privilleges required for a user to execute
> sp_adduser. I am talking only about SQL 2000 here.

 >> Stay informed about: Minimum Permissions for sp_adduser 
Back to top
Login to vote
Munish Narula

External


Since: Mar 12, 2008
Posts: 10



(Msg. 3) Posted: Wed Dec 24, 2008 10:00 am
Post subject: Re: Minimum Permissions for sp_adduser [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi,
I created a new user and made it a member of 3 roles. db_owner,
db_securityadmin and db_accessadmin.

But still i am not able to execute sp_adduser using this new user.

I am getting the error
"User XXX does not have permission to run DBCC auditevents"

Can u please help me with this.

"Russell Fields" wrote:

> Munish
>
> From the BOL: "Only the dbo and members of the sysadmin fixed server role
> can execute sp_adduser." (I assume that dbo includes members of the
> db_owner role, but I have not tested this today.)
>
> So, within a database a dbo can add users, but granting execute on the
> stored procedure will not add the rights to a non-dbo. (And, of course,
> adding logins is higher rights.)
>
> RLF
>
> "Munish Narula" wrote in message
>
> >I am trying to create a new user who has the permission to create a new
> >user
> > in SQL 2000. I have greated him only the rights for excuting sp_adduser.
> > But
> > still this user is not able to create any other user. Is this not suffient
> > privilege?
> >
> > What are the minimum set of privilleges required for a user to execute
> > sp_adduser. I am talking only about SQL 2000 here.
>
>
 >> Stay informed about: Minimum Permissions for sp_adduser 
Back to top
Login to vote
Tom Moreau

External


Since: Apr 21, 2004
Posts: 502



(Msg. 4) Posted: Wed Dec 24, 2008 1:36 pm
Post subject: Re: Minimum Permissions for sp_adduser [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Erland already answered this. Use CREATE USER and grant ALTER ANY USER to
the user.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau


"Munish Narula" wrote in message

Hi,
I created a new user and made it a member of 3 roles. db_owner,
db_securityadmin and db_accessadmin.

But still i am not able to execute sp_adduser using this new user.

I am getting the error
"User XXX does not have permission to run DBCC auditevents"

Can u please help me with this.

"Russell Fields" wrote:

> Munish
>
> From the BOL: "Only the dbo and members of the sysadmin fixed server role
> can execute sp_adduser." (I assume that dbo includes members of the
> db_owner role, but I have not tested this today.)
>
> So, within a database a dbo can add users, but granting execute on the
> stored procedure will not add the rights to a non-dbo. (And, of course,
> adding logins is higher rights.)
>
> RLF
>
> "Munish Narula" wrote in message
>
> >I am trying to create a new user who has the permission to create a new
> >user
> > in SQL 2000. I have greated him only the rights for excuting sp_adduser.
> > But
> > still this user is not able to create any other user. Is this not
> > suffient
> > privilege?
> >
> > What are the minimum set of privilleges required for a user to execute
> > sp_adduser. I am talking only about SQL 2000 here.
>
>
 >> Stay informed about: Minimum Permissions for sp_adduser 
Back to top
Login to vote
Russell Fields

External


Since: Jan 10, 2008
Posts: 608



(Msg. 5) Posted: Wed Dec 24, 2008 2:00 pm
Post subject: Re: Minimum Permissions for sp_adduser [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Munish,

It turns out that db_owner will not do, the account must actually be the
owner of the database and therefore the 'dbo' user. However, according to
the SQL Server 2000 Books Online:

db_accessadmin - Can add or remove user IDs.
db_securityadmin - Can manage all permissions, object ownerships, roles and
role memberships.

So, db_accessadmin seems to be what you need.

However, "sp_adduser" is hardcoded to reject even these rights. But if you
change to the SQL Server 2000 preferred command, "sp_grantdbaccess" it will
work for you.

Regarding your latest error message, it is discussed (if you are curious) in
this article by Brian Kelley.
http://www.sqlservercentral.com/articles/Security/sqlserversecuritypro...dconsof

Please note that in SQL Server 2005 both of these stored procedures have
been superceded by:
CREATE USER

RLF






"Munish Narula" wrote in message

> Hi,
> I created a new user and made it a member of 3 roles. db_owner,
> db_securityadmin and db_accessadmin.
>
> But still i am not able to execute sp_adduser using this new user.
>
> I am getting the error
> "User XXX does not have permission to run DBCC auditevents"
>
> Can u please help me with this.
>
> "Russell Fields" wrote:
>
>> Munish
>>
>> From the BOL: "Only the dbo and members of the sysadmin fixed server role
>> can execute sp_adduser." (I assume that dbo includes members of the
>> db_owner role, but I have not tested this today.)
>>
>> So, within a database a dbo can add users, but granting execute on the
>> stored procedure will not add the rights to a non-dbo. (And, of course,
>> adding logins is higher rights.)
>>
>> RLF
>>
>> "Munish Narula" wrote in message
>>
>> >I am trying to create a new user who has the permission to create a new
>> >user
>> > in SQL 2000. I have greated him only the rights for excuting
>> > sp_adduser.
>> > But
>> > still this user is not able to create any other user. Is this not
>> > suffient
>> > privilege?
>> >
>> > What are the minimum set of privilleges required for a user to execute
>> > sp_adduser. I am talking only about SQL 2000 here.
>>
>>
 >> Stay informed about: Minimum Permissions for sp_adduser 
Back to top
Login to vote
Uri Dimant

External


Since: Aug 24, 2003
Posts: 1744



(Msg. 6) Posted: Fri Dec 26, 2008 3:25 am
Post subject: Re: Minimum Permissions for sp_adduser [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Tom
But the OP is using SQL Server 2000
I suggested to him adding the user into securityadmin server role and try
it again, what do you think?

"Tom Moreau" wrote in message

> Erland already answered this. Use CREATE USER and grant ALTER ANY USER to
> the user.
>
> --
> Tom
>
> ----------------------------------------------------
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
>
> "Munish Narula" wrote in message
>
> Hi,
> I created a new user and made it a member of 3 roles. db_owner,
> db_securityadmin and db_accessadmin.
>
> But still i am not able to execute sp_adduser using this new user.
>
> I am getting the error
> "User XXX does not have permission to run DBCC auditevents"
>
> Can u please help me with this.
>
> "Russell Fields" wrote:
>
>> Munish
>>
>> From the BOL: "Only the dbo and members of the sysadmin fixed server role
>> can execute sp_adduser." (I assume that dbo includes members of the
>> db_owner role, but I have not tested this today.)
>>
>> So, within a database a dbo can add users, but granting execute on the
>> stored procedure will not add the rights to a non-dbo. (And, of course,
>> adding logins is higher rights.)
>>
>> RLF
>>
>> "Munish Narula" wrote in message
>>
>> >I am trying to create a new user who has the permission to create a new
>> >user
>> > in SQL 2000. I have greated him only the rights for excuting
>> > sp_adduser.
>> > But
>> > still this user is not able to create any other user. Is this not
>> > suffient
>> > privilege?
>> >
>> > What are the minimum set of privilleges required for a user to execute
>> > sp_adduser. I am talking only about SQL 2000 here.
>>
>>
>
 >> Stay informed about: Minimum Permissions for sp_adduser 
Back to top
Login to vote
Erland Sommarskog2

External


Since: May 30, 2004
Posts: 2061



(Msg. 7) Posted: Fri Dec 26, 2008 3:25 am
Post subject: Re: Minimum Permissions for sp_adduser [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Uri Dimant (urid@iscar.co.il) writes:
> Hi Tom
> But the OP is using SQL Server 2000
> I suggested to him adding the user into securityadmin server role and try
> it again, what do you think?

Oops! But didn't he say SQL 2005 in his first post?

Anyway, I think Russell has already sorted this out with help of
sp_helptext: sp_adduser requires that you are dbo, period. But the
newer sp_grantdbaccess, being a member of db_accessadmin is sufficient.


--
Erland Sommarskog, SQL Server MVP, esquel.TakeThisOut@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
 >> Stay informed about: Minimum Permissions for sp_adduser 
Back to top
Login to vote
Uri Dimant

External


Since: Aug 24, 2003
Posts: 1744



(Msg. 8) Posted: Sun Dec 28, 2008 3:25 am
Post subject: Re: Minimum Permissions for sp_adduser [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

No, he isn't. Also the OP said that the user was already member of db_owner
database role

"Erland Sommarskog" wrote in message

> Uri Dimant (urid@iscar.co.il) writes:
>> Hi Tom
>> But the OP is using SQL Server 2000
>> I suggested to him adding the user into securityadmin server role and
>> try
>> it again, what do you think?
>
> Oops! But didn't he say SQL 2005 in his first post?
>
> Anyway, I think Russell has already sorted this out with help of
> sp_helptext: sp_adduser requires that you are dbo, period. But the
> newer sp_grantdbaccess, being a member of db_accessadmin is sufficient.
>
>
> --
> Erland Sommarskog, SQL Server MVP, esquel DeleteThis @sommarskog.se
>
> Links for SQL Server Books Online:
> SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
> SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
> SQL 2000:
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
>
 >> Stay informed about: Minimum Permissions for sp_adduser 
Back to top
Login to vote
Russell Fields

External


Since: Jan 10, 2008
Posts: 608



(Msg. 9) Posted: Mon Dec 29, 2008 9:10 am
Post subject: Re: Minimum Permissions for sp_adduser [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Uri,

Yes he did say he was db_owner, per my first suggestion.

But it turns out that being a member of db_owner is not enough, even though
it should be, because it does not map a login to the "dbo" user. (That
mapping is reserved for the owner of the database (the SID in sysdatabases)
and for 'sa' or other sysadmins.)

The sp_adduser procedure is hardcoded, not for the rights you actually have,
but for whether or not you are the "dbo" user.

RLF


"Uri Dimant" wrote in message

> No, he isn't. Also the OP said that the user was already member of
> db_owner database role
>
> "Erland Sommarskog" wrote in message
>
>> Uri Dimant (urid@iscar.co.il) writes:
>>> Hi Tom
>>> But the OP is using SQL Server 2000
>>> I suggested to him adding the user into securityadmin server role and
>>> try
>>> it again, what do you think?
>>
>> Oops! But didn't he say SQL 2005 in his first post?
>>
>> Anyway, I think Russell has already sorted this out with help of
>> sp_helptext: sp_adduser requires that you are dbo, period. But the
>> newer sp_grantdbaccess, being a member of db_accessadmin is sufficient.
>>
>>
>> --
>> Erland Sommarskog, SQL Server MVP, esquel.DeleteThis@sommarskog.se
>>
>> Links for SQL Server Books Online:
>> SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
>> SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
>> SQL 2000:
>> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
>>
>
>
 >> Stay informed about: Minimum Permissions for sp_adduser 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Minimum permissions to restore a database - Given two servers: DevServer and ProdServer Each Server has an AppAdmin user. AppAdmin is a member of dbcreator role on both servers. So long as we are creating DBs from scratch, all is good. The problem I face is: When AppAdmin restores a database..

Minimum permissions for Backup/Restore - I'm fairly new to SQLServer security and I'm finding that once someone has access to the physical file it seems to be very difficult to prevent them from making updates. I used to use Access and with that I was able to secure the database and set the...

minimum permissions to grant / delete logins - I'm creating an admin tool for the app I'm working on and I want to be able to grant the business admin user the ability to create logins, and delete logins; >>but only allow them to delete the login if the user only has permissions to the database...

Permissions Across Databases - I have two databases. In the first database I have a view that needs to be able insert into a table in the second database. I want the user to only have select permissions in the second database’s table. Because of this restriction the view canno...

Where are the permissions documented? - Under what topic in BOL is the meaning of the various permissions such as "Alter", "References", etc., documented? In other words, where is it documented, what you can DO if you have been granted "References" or "Imp...
   Database Help (Home) -> Security All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]