working with sa account

  • I am working with sql 2008 and using all features of security but not able to understand the need and usage of "sa" account can anyone throw light on it

    and also the actual use of "public" role which exists in all databases in sql?

    Thanks

  • sa is like the Windows "Administrator" account for the instance. When logged in as sa you can do any action on the instance. Lots of people, including myself, like to disable the Login since it is a well known attack vector. If your instance is in Mixed Security Mode (most are), the sa Login is enabled and someone can crack the password they can gain control of the instance.

    The public Database Role is a role all Users are a member of. Think of it as the "Everyone" group you see in Windows. It has limited privileges but all Users are a member of it and they cannot be removed from the Role.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • yes I got your answer but still why public role exists when we have fixed database roles and user defined roles.what are the permission given to this role.

    and regarding "sa" account when it is best to use this account.

  • sej2008 (3/14/2013)


    yes I got your answer but still why public role exists when we have fixed database roles and user defined roles.what are the permission given to this role.

    It's like the "Everyone" Windows group. Members of public (i.e. everyone) inherits a base set of permissions all users need in order to work within the database. Things like SELECT on the Catalog View sys.tables.

    The public Role can be used to also grant everyone a permission to a User-defined Object. Say you had a Stored Procedure you wanted everyone to be able to execute. You have the option of granting EXEC on that Stored Procedure to public, although that practice is discouraged in favor or creating a User-defined Database Role, granting EXEC on the Stored Procedure to the new Role, and then adding public as a member of the new Role, i.e. do not change the set of permissions granted directly to the public Role.

    and regarding "sa" account when it is best to use this account.

    You would use the sa Login when you needed to access the database instance as an "Administrator." Ideally though, I recommend adding specific Windows Domain Logins to the sysadmin Fixed Server Role and disabling the sa Login for the reasons previously mentioned.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • Thanks so much

  • Just to clarify: When you change to mixed-mode authentication from Integrated Security the 'sa' account is by default disabled. If it is enabled then it is because a SYSADMIN has enabled it.....

  • opc.three (3/14/2013)


    sa is like the Windows "Administrator" account for the instance. When logged in as sa you can do any action on the instance. Lots of people, including myself, like to disable the Login since it is a well known attack vector. If your instance is in Mixed Security Mode (most are), the sa Login is enabled and someone can crack the password they can gain control of the instance.

    The public Database Role is a role all Users are a member of. Think of it as the "Everyone" group you see in Windows. It has limited privileges but all Users are a member of it and they cannot be removed from the Role.

    Just to clarify: When you change to mixed-mode authentication from Integrated Security the 'sa' account is by default disabled. If it is enabled then it is because a SYSADMIN has enabled it.....

  • kevaburg (3/20/2013)


    opc.three (3/14/2013)


    sa is like the Windows "Administrator" account for the instance. When logged in as sa you can do any action on the instance. Lots of people, including myself, like to disable the Login since it is a well known attack vector. If your instance is in Mixed Security Mode (most are), the sa Login is enabled and someone can crack the password they can gain control of the instance.

    The public Database Role is a role all Users are a member of. Think of it as the "Everyone" group you see in Windows. It has limited privileges but all Users are a member of it and they cannot be removed from the Role.

    Just to clarify: When you change to mixed-mode authentication from Integrated Security the 'sa' account is by default disabled. If it is enabled then it is because a SYSADMIN has enabled it.....

    That is not my experience but I waited to respond so I could verify. When switching from Windows Authentication Mode to Mixed Mode the status of the sa Login is not changed. If it was enabled before the change it stays enabled.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • Good point. I actually just wanted to say that if was disabled in Windows authentication it would remain disabled in mixed-mode. You have cleared that point up!

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply