signs of life
This commit is contained in:
21
docs/windows-ssh.md
Normal file
21
docs/windows-ssh.md
Normal file
@@ -0,0 +1,21 @@
|
||||
https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=powershell&pivots=windows-server-2025
|
||||
|
||||
|
||||
if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue)) {
|
||||
Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it..."
|
||||
New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 2222
|
||||
} else {
|
||||
Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists."
|
||||
}
|
||||
|
||||
|
||||
|
||||
https://learn.microsoft.com/en-us/windows/wsl/networking#mirrored-mode-networking
|
||||
|
||||
New-NetFirewallHyperVRule -Name "WslSshServer" -DisplayName "WslSshServer" -Direction Inbound -VMCreatorId '{40E0AC32-46A5-438A-A0B2-2B479E8F2E90}' -Protocol TCP -LocalPorts 22
|
||||
|
||||
|
||||
Get-NetFirewallHyperVRule |
|
||||
Where-Object { $_.Enabled -eq 'True' } |
|
||||
Get-NetFirewallPortFilter |
|
||||
Where-Object { $_.LocalPort -eq 22 }
|
||||
Reference in New Issue
Block a user