Ever seen a new application giving you pop ups to give it access to different kinds of files in your computer? It is asking because the files it is trying to access has a higher privilege that its current privilege. Today, We will be covering UAC, integrity privilege and access token while answering why you might need to run cmd as an administrator.
UAC (User Account Control)
Pop-ups/prompts given to us are Windows way of asking whether we should give access to applications asking for access. You can control the pop-ups by viewing the UAC(User Account Control) settings by changing the notification levels.
Pop-ups are like apps asking for privilege to edit/use your files. Sometimes we might want to allow the app to have access whereas other times we might not want to allow them, especially if they are malware. There are integrity levels set by MS in default such that not all access is granted to everyone.
Different types of integrity levels:
- Untrusted Integrity
- Low Integrity
- Medium Integrity
- High Integrity
- System Integrity
- Trusted Installer
What are these integrity levels?
Untrusted Integrity are given to applications that are not authentic. Low Integrity are given to browsers. Medium Integrity are for us users. High Integrity is administrator level. System Integrity and Trusted Installer can be used by MS only.
Important files have requirements of access. For example, every files contain access token which has an integrity level requirement. If the integrity level requirement is High Integrity then it means all levels below it can not access it unless they have admin privileges.
Read more on integrity levels!
Remember: MS in default does not recommend you to use admin privileges due to potential exploits. So, give admin level privilege to applications you trust.
Before, we answer and summarize our topic, lets see different ways we could open command prompt.
Ways to open cmd as administrator
Step 1: Open cmd normally without any administrator privilege. You need administrator password for this. Type in the following code to open another window to run as administrator.
runas /user:administrator "C:\WINDOWS\system32\cmd.exe"
Step 2: Open windows search box in bottom left corner. Search “cmd”, right click and select app to run as administrator.
Step 3: Press “ windows key + r” to open run box > Type “cmd” > Press “control + shift + enter”. (Accept the prompted access)
Why do we need admin privileges in cmd?
Finally, we need admin privileges to counter these problems of integrity levels set by MS while accessing different types of files through cmd. Without admin privileges we are unable to edit, execute and view files depending on the access token and it’s integrity level requirements. Remember with admin privilege you will have unrestricted access. Therefore, it might be better to use it minimally.