Windows 10 Administrator and Linux SuperUser

2

I understand that in Windows 10 Administrator is equivalent to the SuperUser in Linux. But I don't have the same power over my Machine as Linux gives with su or sudo

as an Example in Linux with sudo, commands like

rm -rf / --no-preserve-root

won't be a problem. But in windows I can't even delete Window.old folder even after being Administrator and taking Full Control from Security and taking Ownership with

takeown /F Windows.old

also tried using rimraf tool from npm. Still won't completely delete the files.

So my Question is there any way in Windows 10 to take full control like sudo provides or its just that's how windows works.

Ahmad

Posted 2016-06-29T06:56:49.413

Reputation: 201

Use the built-in Administrator in Windows – iSR5 – 2016-06-29T07:06:57.833

useful link : https://support.microsoft.com/en-us/kb/555910

– iSR5 – 2016-06-29T07:07:34.853

you mean use the Administrator account rather then login in as user and taking Administrator Privileges? – Ahmad – 2016-06-29T07:10:03.573

To my understanding Its the same Privileges with different steps. as mention here: http://superuser.com/a/215124/201811

– Ahmad – 2016-06-29T07:15:31.773

@Ahmad your understanding isn't correct, the built-in Administrator account, has a few differences between a user profile in the Administratoe user group. Of course how you delete Windows.Old is well documented, you should use the clean-up tool, after you have elevated it's permission. – Ramhound – 2016-06-29T11:32:06.047

@Ahmad, Ramhound is correct, and as he said, you can use a third-party tool to clean up the Windows 7 old backup, try CCleaner, it has this feature. – iSR5 – 2016-06-29T16:28:34.870

Its not about cleaning up that folder. I'm talking about talking full control So even if I wanna delete everything I see in C drive I should have the permissions to do so. – Ahmad – 2016-06-30T04:21:27.190

Answers

3

I understand that in Windows 10 Administrator is equivalent to the SuperUser in Linux.

It's not.

First, administrators are constrained by UAC. If you're logged in as an administrator, but aren't granted full access, first make sure you're using an elevated Command Prompt window (e.g. by holding Ctrl+Shift while opening it, and getting the UAC prompt).

(Linux recently has been moving to a different model where apps perform actions through privileged services, rather than having to run the whole app as root.)

Second, administrators have different privileges. root on Linux has CAP_FOWNER and CAP_DAC_OVERRIDE (see capabilities), allowing it to bypass all permission checks. (On other Unix-like systems, the bypass is granted to uid 0 in general.)

Administrators on Windows don't have the same; by default, they only have SeTakeOwnershipPrivilege active (similar to Linux CAP_CHOWN; see privileges). In other words, administrators can reset an object's security settings, but not bypass them.

To get a full security bypass on Windows, one would need to enable SeBackupPrivilege and SeRestorePrivilege for read & write access respectively (e.g. using this tool). Administrators are allowed to use these privileges (after UAC elevation), but they aren't active by default – a process must 'enable' them first.

(You can see the available & enabled privileges in Process Explorer's "Security" tab, or in Process Hacker's "Token" tab. It's also possible to manually enable them e.g. for a running cmd.exe process.)

user1686

Posted 2016-06-29T06:56:49.413

Reputation: 283 655

Remove-Item : Cannot remove item C:$WINDOWS.~BT\Sources\SafeOS\SafeOS.Mount\windows\win sxs\wow64_microsoft-windows-b..iagnostic.resources_31bf3856ad364e35_10.0.14342.1000_zh-c n_b2ecdd1e524d0368\memtest.exe.mui: Access to the path is denied. At line:1 char:1

  • Remove-Item -Path "C:`$WINDOWS.~BT\Sources" -Force
  • < – Ahmad – 2016-06-30T06:33:05.193

I used those dlls and got "PS C:> Get-SeBackupPrivilege SeBackupPrivilege is enabled"

but still access denied with Administrator Powershell. – Ahmad – 2016-06-30T06:34:55.473

also tried Copy still the same response: copy : The file cannot be accessed by the system. At line:1 char:1

  • copy .\wgl4_boot.ttf D:\
  •   + CategoryInfo          : NotSpecified: (:) [Copy-Item], IOException
      + FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.CopyI
     temCommand
    
  • < – Ahmad – 2016-06-30T06:38:07.350

-1

Windows administrator is closer to Linux Super-user than root.

In windows, the system is the closest equivalent to root.

Note that Windows 10 should automatically delete the Windows.old folder one month after you performed your upgrade.

Officially, it can be deleted with 'disk cleanup'. See the exact step-by-step guide here

Overmind

Posted 2016-06-29T06:56:49.413

Reputation: 8 562