Managing User Accounts, Passwords, and Logons : Introducing Access Control in Windows
Note:
To exercise full discretionary control over individual files, you must store those files on an NTFS volume. For the sake of compatibility, Windows 7 supports the FAT and FAT32 file systems used by early Windows versions and many USB flash drives, and the exFAT file system used on some removable drives. However, none of the FAT-based file systems support file permissions.
To determine which users have access to a resource, Windows assigns a security identifier (SID) to each user account. Your SID (a gigantic number guaranteed to be unique) follows you around wherever you go in Windows. When you log on, the operating system first validates your user name and password. Then it creates a security access token. You can think of this as the electronic equivalent of an ID badge. It includes your user name and SID, plus information about any security groups to which your account belongs. Any program you start gets a copy of your security access token.
With User Account Control (UAC) turned on, administrators who log on get two security access tokens—one that has the privileges of a standard user, and one that has the full privileges of an administrator.
Whenever you attempt to walk through a controlled "door" in Windows (for example, when you connect to a shared printer) or any time a program attempts to do so on your behalf, the operating system examines your security access token and decides whether to let you pass. If access is permitted, you notice nothing. If access is denied, you get to hear a beep and read a refusal message.
In determining whom to let pass and whom to block, Windows consults the resource's access control list (ACL). This is simply a list of SIDs and the access privileges associated with each one. Every resource subject to access control has an ACL.
This manner of allowing and blocking access to resources such as files and printers is essentially unchanged since Windows NT. UAC, which was introduced in Windows Vista, adds another layer of restrictions based on user accounts. Although UAC is sometimes confused with (blamed for?) the restrictions imposed by discretionary access control lists (described in the preceding paragraphs), it's actually unrelated. UAC is a method of implementing the rule of least-privilege user access—a fancy way of saying that a user account should have only the minimum privileges required to perform a task; this practice is intended to prevent malicious programs from using the power of an account to do bad things.
With UAC turned on,
applications are normally launched using an administrator's standard
user token. (Standard users, of course, have only a standard user
token.) If an application requires administrator privileges, UAC asks
for your consent (if you're logged on as an administrator) or the
credentials of an administrator (if you're logged on as a standard user)
before letting the application run. With UAC turned off,
Windows works in the same (rather dangerous) manner as previous
versions: administrator accounts can do just about anything (sometimes
getting those users in trouble), and standard accounts don't have the
privileges needed to run many older programs.
1. Permissions and Rights
Windows distinguishes two types of access privileges: permissions and rights. A permission is the ability to access a particular object in some defined manner—for example, to write to an NTFS file or to modify a printer queue. A right is the ability to perform a particular systemwide action, such as logging on or resetting the clock.
The owner of a resource (or an administrator) assigns permissions to the resource via its properties dialog box. For example, if you are the printer owner or have administrative privileges, you can restrict someone from using a particular printer by visiting the properties dialog box for that printer. Administrators set rights via the Local Security Policy console. (This console is available only in the Professional, Enterprise, and Ultimate editions of Windows 7. In the other editions, rights for various security groups are predefined and unchangeable.) For example, an administrator could grant someone the right to install a device driver.
Note:
In this book, as in many of the Windows messages and dialog boxes, privileges serves as an informal term encompassing both permissions and rights.
2. User Accounts and Security Groups
The backbone of Windows security is the ability to uniquely identify each user. While setting up a computer—or at any later time—an administrator creates a user account for each user. The user account is identified by a user name and is (optionally) secured by a password, which the user provides when logging on to the system. Windows then controls, monitors, and restricts access to system resources based on the permissions and rights associated with each user account by the resource owners and the system administrator.
Account type is a simplified way of describing membership in a security group, a collection of user accounts. Windows classifies each user account as one of three account types:
Administrator Members of the Administrators group are classifed as administrator accounts. By default, the Administrators group includes the first account you create when you set up the computer and an account named Administrator that is disabled and hidden by default. Unlike other account types, administrators have full control over the system. Among the tasks that only administrators can perform are the following:
Create, change, and delete user accounts and groups
Install and uninstall programs
Configure automatic updating with Windows Update
Install an ActiveX control
Install or remove hardware device drivers
Share folders
Set permissions
Access all files, including those in another user's folder
Take ownership of files
Copy or move files into the %ProgramFiles% or %SystemRoot% folders
Restore backed-up system files
Grant rights to other user accounts and to themselves
Configure Parental Controls
Configure Windows Firewall
Standard user Members of the Users group are classified as standard user accounts. (In Windows XP, Users group members are called limited accounts.) Many tasks that were available only to administrators in previous Windows versions can be performed in Windows 7 by standard users. These additional tasks do not affect overall system security, and their prohibition in Windows XP and Windows 2000 made it impractical for most people to run without full administrative privileges; in Windows 7—as in Windows Vista—it makes sense to use a standard account. A partial list of tasks available to standard user accounts includes
Change the password and picture for their own user account
Use programs that have been installed on the computer
Install system and driver updates using Windows Update
Install approved ActiveX controls
Configure a secure Wi-Fi connection
Refresh a network adapter and the system's IP address
View permissions
Create, change, and delete files in their document folders and in shared document folders
Restore their own backed-up files
View the system clock and calendar, and change the time zone
Set personalization options, such as themes, desktop background, and so on
Select a display dots-per-inch (DPI) setting to adjust text size
Configure power options
Log on in Safe Mode
View Windows Firewall settings
Guest Members of the Guests group are shown as guest accounts. Guest accounts have privileges similar to standard accounts, with some limitations. A user logged on with the Guest account (but not any other account that is a member of the Guests group) cannot create a password for the account.
Note:
User accounts that are not a member of the Administrators, Users, or Guests group do not appear in User Accounts in Control Panel. There's seldom reason to set up an account that doesn't belong to one of these groups, but if you do need to work with such accounts, you must use one of the other user account management tools.
Assigning an appropriate account type to the people who use your computer is straightforward. At least one user must be an administrator; naturally, that should be the person who administers the computer. All other regular users should each have a standard user account. Use a guest account if you have guests or occasional users; that way, they can use your computer without gaining access to your files.
Security groups allow a system administrator to create classes of users who share common privileges. For example, if everyone in the accounting department needs access to the Payables folder, the administrator can create a group called Accounting and grant the entire group access to that folder. If the administrator then adds all user accounts belonging to employees in the accounting department to the Accounting group, these users will automatically have access to the Payables folder. A user account can belong to one group, more than one group, or no group at all.
In large networks based on Active Directory domains, groups can be a valuable administrative tool. They simplify the job of ensuring that all members with common access needs have an identical set of privileges. We don't recommend creating or using groups other than the built-in Administrators, Users, and Guests groups on standalone and workgroup-based computers, however.
Permissions and rights for group members are cumulative. That means that if a user account belongs to more than one group, the user enjoys all of the privileges accorded to all groups of which the user account is a member.
3. Learning About Your Own Account with Whoami
Windows includes a command-line utility called Whoami (Who Am I?). You can use Whoami to find out the name of the account that's currently logged on, its SID, the names of the security groups of which it's a member, and its privileges. To use Whoami, open a Command Prompt window. (You don't need elevated privileges.)
Then, to learn the name of the logged-on user, type whoami. (This is particularly useful if you're logged on as a standard user, but running an elevated Command Prompt window—when it might not be obvious which account is currently "you.") If you're curious about your SID, type whoami /user. To see a list of your account's group memberships, type whoami /groups /fo list. To learn which privileges are enabled for the logged-on account, type whoami /priv /fo list. For a complete list of Whoami parameters, type whoami /?.