Skip to content

sc : Access to the path 'C:\windows\system32\config' is denied. #1700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
isdanni opened this issue Nov 3, 2020 · 1 comment
Closed

sc : Access to the path 'C:\windows\system32\config' is denied. #1700

isdanni opened this issue Nov 3, 2020 · 1 comment

Comments

@isdanni
Copy link

isdanni commented Nov 3, 2020

OperatingSystem:

PS C:\windows\system32> [System.Environment]::OSVersion.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
10     0      18363  0

What is failing

  • Following this guide in vscode on how to configure ssh-agent in PowerShell(run as admin), but running cmds(I have openSSH installed already) gave me the following error:
PS C:\windows\system32> sc config ssh-agent start==auto
Set-Content : A positional parameter cannot be found that accepts argument 'start==auto'.
At line:1 char:1
+ sc config ssh-agent start==auto
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-Content], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SetContentCommand

PS C:\windows\system32> sc config ssh-agent
sc : Access to the path 'C:\windows\system32\config' is denied.
At line:1 char:1
+ sc config ssh-agent
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-Content], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.SetContentCommand
  • Run as admin.

Expected: Should show config success as it did on my other PC.

So far I tried

  1. restart Powershell, run as admin & repeat above steps;
  2. Checked this issue
  3. Restart ssh-agent.
  4. Check ssh status:
PS> ssh-agent.exe
unable to start ssh-agent service, error :1058


PS C:\windows\system32> ssh-agent.exe
PS C:\windows\system32> Get-Service ssh-agent

Status   Name               DisplayName
------   ----               -----------
Running  ssh-agent          OpenSSH Authentication Agent

PS C:\windows\system32> Start-Service ssh-agent
@isdanni isdanni closed this as completed Nov 5, 2020
@isdanni
Copy link
Author

isdanni commented Nov 5, 2020

Closing as it's no longer a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant