This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://docs.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate | |
<# | |
In order to configure Git to use the "Windows" OpenSSH (found at %SystemRoot%\System32\OpenSSH), | |
rather than the one packaged with Git for Windows (at %ProgramFiles%\Git\usr\bin) and enable agent forwarding, | |
set Git's core.sshCommand configuration property "C:\Windows\System32\OpenSSH\ssh.exe" -T (with double-quotes). | |
#> | |
# Using environmental variable GIT_SSH_COMMAND: | |
[Environment]::SetEnvironmentVariable("GIT_SSH_COMMAND", """$((Get-Command ssh).Source)"" -T", [System.EnvironmentVariableTarget]::User) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_server_configuration | |
# Install OpenSSH client and server | |
Get-WindowsCapability -Online -Name OpenSSH* | Add-WindowsCapability -Online | |
# Set default SHH shell to PowerShell Core | |
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "${env:ProgramFiles}\PowerShell\7\pwsh.exe" -PropertyType String -Force | |
# Set the ssh-agent service to be started automatically | |
Get-Service -Name ssh-agent | Set-Service -StartupType Automatic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
To do - from OneNote: Win10 hardening (on public connections) | |
§ Disable IE auto configuration | |
§ Disable SMB1 | |
Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol | |
§ Enable firewall, disable network sharing and discovery (public network profile) | |
Set-NetFirewallProfile -Name Public -Enabled True | |
Get-NetFirewallRule -DisplayGroup "File and Printer Sharing" | ? {$_.Profile -eq 'Public'} | Set-NetFirewallRule -Enabled false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$RemoteNetwork = "192.168.1.0/24", "10.0.0.0/24" | |
# Enable connection when both VPN server and client is behind NAT-T | |
# http://support.microsoft.com/kb/926179 | |
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\PolicyAgent -Name AssumeUDPEncapsulationContextOnSendRule -Type DWord -Value 2 -Force | |
# Add route(s) to remote networks | |
$RemoteNetwork | % {Add-VpnConnectionRoute -ConnectionName $VPNConnectionName -DestinationPrefix $_} |