diff --git a/remote-access/windows-setup.ps1 b/remote-access/windows-setup.ps1 index fc7577a..6ce6807 100644 --- a/remote-access/windows-setup.ps1 +++ b/remote-access/windows-setup.ps1 @@ -15,6 +15,7 @@ $ErrorActionPreference = 'Stop' $Key = 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHM2BPUpVpbMxKumLayVSutUsFWUXEfJ/4vxIJ0thbgY status-panel@NA-Ingest' +$IngestIPs = @('10.1.1.1', '10.6.3.222') # NA Ingest on the 10.1 and 10.6 networks $notes = @() # 1. OpenSSH Server, started now and at every boot, allowed through the firewall @@ -40,6 +41,8 @@ if (-not (Get-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -ErrorAction Silentl New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True ` -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 | Out-Null } +# Windows' own rule covers "Private" networks only; open it on any network, but to NA Ingest alone. +Set-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -Profile Any -RemoteAddress $IngestIPs Enable-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' # 2. NA Ingest's key. Administrators read C:\ProgramData\ssh\administrators_authorized_keys, @@ -96,7 +99,7 @@ Write-Host '' Write-Host '===== RESULT (send this to Claude) =====' Write-Host ('pc=' + $env:COMPUTERNAME + ' user=' + $env:USERNAME + ' domain=' + $env:USERDOMAIN) Write-Host ('sshd=' + (Get-Service sshd).Status) -foreach ($nic in $nics) { Write-Host ('nic=' + $nic.Name + ' mac=' + $nic.MacAddress + ' ip=' + ((Get-NetIPAddress -InterfaceIndex $nic.ifIndex -AddressFamily IPv4 -ErrorAction SilentlyContinue).IPAddress -join ',')) } +foreach ($nic in $nics) { Write-Host ('nic=' + $nic.Name + ' mac=' + $nic.MacAddress + ' ip=' + ((Get-NetIPAddress -InterfaceIndex $nic.ifIndex -AddressFamily IPv4 -ErrorAction SilentlyContinue).IPAddress -join ',') + ' network=' + (Get-NetConnectionProfile -InterfaceIndex $nic.ifIndex -ErrorAction SilentlyContinue).NetworkCategory) } if ($tasks) { $tasks | ForEach-Object { Write-Host ('task: ' + $_) } } else { Write-Host 'task: none (no known apps found)' } $notes | ForEach-Object { Write-Host ('note: ' + $_) } Write-Host '========================================'