Sha256: fa814f9a1b02ea582a4d1d3d272f3fdd559b0e5fb1647257c410df91c1e3abeb

Contents?: true

Size: 828 Bytes

Versions: 29

Compression:

Stored size: 828 Bytes

Contents

# Vagrant SSH capability functions

function Set-SSHKeyPermissions {
    param (
        [parameter(Mandatory=$true)]
        [string] $SSHKeyPath,
        [parameter(Mandatory=$false)]
        [string] $Principal=$null
    )

    if(!$Principal) {
        $Principal = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
    }

    # Create the new ACL we want to apply
    $NewAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule(
        $Principal, "FullControl", "None", "None", "Allow")
    $ACL = Get-ACL "${SSHKeyPath}"
    # Disable inherited rules
    $ACL.SetAccessRuleProtection($true, $false)
    # Scrub all existing ACLs from the file
    $ACL.Access | %{$ACL.RemoveAccessRule($_)}
    # Apply the new ACL
    $ACL.SetAccessRule($NewAccessRule)
    Set-ACL "${SSHKeyPath}" $ACL
}

Version data entries

29 entries across 25 versions & 4 rubygems

Version Path
vagrant-unbundled-2.3.6.0 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.3.3.0 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.3.2.0 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.2.19.0 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.2.18.0 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.2.16.0 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.2.14.0 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.2.10.0 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.2.9.0 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.2.8.0 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.2.7.0 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.2.6.2 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.2.6.1 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.2.6.0 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.2.5.0 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.2.4.0 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.2.3.0 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1
vagrant-unbundled-2.2.2.0 plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1