is guest user created by default? | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

is guest user created by default?

‘SQL Server 2000 System Administartion Training Kit’ says that:
‘A guest account (…) does not exist by default in newly created databases’. However, I’ve just created a new database and there is a guest account in it. There is also such an account in the model database and I have not created it. Can anybody explain this? — Marek ‘chopeen’ Grzenkowicz ‘You’re so cute when you’re frustrated.’ — Interpol
From BOL: New Information – SQL Server 2000 SP3. The guest user account allows a login without a user account to access a database. A login assumes the identity of the guest user when both of the following conditions are met: The login has access to an instance of Microsoft® SQL Serverâ„¢ but does not have access to the database through his or her own user account.
The database contains a guest user account.
Permissions can be applied to the guest user as if it were any other user account. The guest user can be deleted and added to all databases except master and tempdb, where it must always exist. By default, a guest user account does not exist in newly created databases. Avoid using the guest account; all logins without their own database permissions obtain the database permissions granted to this account. If you must use the guest account, grant minimum permissions. For example, to add a guest user account to a database named Accounts, run the following code in SQL Query Analyzer: USE Accounts
GO
EXECUTE sp_grantdbaccess guest Luis Martin
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.
Hi ya, has this server perhaps been upgraded from SQL7 or prior? A standard built SQL2000 server won’t have a guest account in the model database and therefore it won’t exist in any new database by default Cheers
Twan
quote:Originally posted by Twan has this server perhaps been upgraded from SQL7 or prior? A standard built SQL2000 server won’t have a guest account in the model database and therefore it won’t exist in any new database by default
No. This is not an upgrade of any kind. I tested this problem on two different machines. One is running Standard Edition and the other one – Personal Edition. PE – there is a guest account in model database
SE – there is no guest account in model database Any idea why? — Marek ‘chopeen’ Grzenkowicz ‘You’re so cute when you’re frustrated.’ — Interpol
It might be specific to Personal Edition. Either the guest login exist in the model database by default or someone added it. It does not exist in the model on Standard, Enterprise or Developer Edition. If it exist in model all new databases will get it too.
quote:Originally posted by Argyle If it exist in model all new databases will get it too.
Yeah, I know that.
quote:Originally posted by Argyle Either the guest login exist in the model database by default or someone added it.
I am positive that nobody created it.
quote:Originally posted by Argyle It does not exist in the model on Standard, Enterprise or Developer Edition.
This is what I really needed to know.
Thanks for this information. — Marek ‘chopeen’ Grzenkowicz ‘You’re so cute when you’re frustrated.’ — Interpol
]]>