PowerShell / PowerShell/Win32-OpenSSH

v9.1.0.0p1-Beta install-sshd.ps1 fails with The value '268435456' is not valid for this usage of the type FileSystemRights

Open
#2,017 3 comments 1 reaction 1 assignee View on GitHub

@vthiebaut10 is already working on this.

Since Dec 19, 2022.

Area-Install Issue-Bug Known-workaround
Dominant language
No language data
Stars
8.3k
Forks
819
PR merge metrics
No merged PRs in 30d

Description

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.
Steps to reproduce
  1. unzip https://github.com/PowerShell/Win32-OpenSSH/releases/download/v9.1.0.0p1-Beta/OpenSSH-Win64.zip to C:\Program Files\OpenSSH
  2. call install-sshd.ps1 -Confirm:$false
  3. observe the error

You can find my vagrant environment at https://github.com/rgl/openssh-server-windows-vagrant/blob/wip/provision.ps1#L26

Expected behavior
it should have installed with success
Actual behavior
sshd:   [*] C:\Program Files\OpenSSH\moduli
    sshd: Inheritance is removed from 'C:\Program Files\OpenSSH\moduli'.
    sshd: 'BUILTIN\Users' now has Read access to 'C:\Program Files\OpenSSH\moduli'.
    sshd: 'APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES' now has Read access to 'C:\Program Files\OpenSSH\moduli'.
    sshd: 'APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES' now has Read access to 'C:\Program Files\OpenSSH\moduli'.
    sshd:       Repaired permissions
    sshd: 
    sshd:   [*] C:\ProgramData\ssh
    sshd: Inheritance is removed from 'C:\ProgramData\ssh'.
    sshd: ERROR: Exception calling ".ctor" with "5" argument(s): "The value '268435456' is not valid for this usage of the type FileSystemRights.
    sshd: Parameter name: fileSystemRights"
    sshd: ERROR: at Repair-FilePermissionInternal, C:\Program Files\OpenSSH\OpenSSHUtils.psm1: line 624
    sshd: ERROR: at Repair-FilePermission, C:\Program Files\OpenSSH\OpenSSHUtils.psm1: line 354
    sshd: ERROR: at Repair-SSHFolderPermission, C:\Program Files\OpenSSH\OpenSSHUtils.psm1: line 286
    sshd: ERROR: at <ScriptBlock>, C:\Program Files\OpenSSH\install-sshd.ps1: line 110
    sshd: ERROR: at <ScriptBlock>, C:\vagrant\provision.ps1: line 26
    sshd: ERROR: at <ScriptBlock>, C:\tmp\vagrant-shell.ps1: line 102
    sshd: ERROR EXCEPTION: System.Management.Automation.MethodInvocationException: Exception calling ".ctor" with "5" argument(s): "The value '268435456' is not valid for this usage of the type FileSystemRights.
    sshd: ERROR EXCEPTION: Parameter name: fileSystemRights" ---> System.ArgumentOutOfRangeException: The value '268435456' is not valid for this usage of the type FileSystemRights.
    sshd: ERROR EXCEPTION: Parameter name: fileSystemRights
    sshd: ERROR EXCEPTION:    at System.Security.AccessControl.FileSystemAccessRule.AccessMaskFromRights(FileSystemRights fileSystemRights, AccessControlType controlType)
    sshd: ERROR EXCEPTION:    at System.Security.AccessControl.FileSystemAccessRule..ctor(IdentityReference identity, FileSystemRights fileSystemRights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
    sshd: ERROR EXCEPTION:    --- End of inner exception stack trace ---
    sshd: ERROR EXCEPTION:    at System.Management.Automation.DotNetAdapter.AuxiliaryConstructorInvoke(MethodInformation methodInformation, Object[] arguments, Object[] originalArguments)
    sshd: ERROR EXCEPTION:    at System.Management.Automation.DotNetAdapter.ConstructorInvokeDotNet(Type type, ConstructorInfo[] constructors, Object[] arguments)
    sshd: ERROR EXCEPTION:    at Microsoft.PowerShell.Commands.NewObjectCommand.CallConstructor(Type type, ConstructorInfo[] constructors, Object[] args)
The
Error details

No response

Environment data
n/a
Version

v9.1.0.0p1-Beta

Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.