5.3 KiB
Windows Remote Access Baseline
Purpose
Prepare a Windows garage project computer for agent control through SSH and remote desktop through TightVNC Server, without storing credentials in Git.
Verified Reference
Verified on wuu on 2026-05-24:
- TightVNC Server
2.8.87installed through winget packageGlavSoft.TightVNC. - TightVNC service
tvnserverruns automatically and listens on TCP5900and5800. - Handshake on
192.168.1.192:5900and10.8.1.57:5900advertisesVNCAuth, not unauthenticatedNone. - The user set the primary VNC password interactively outside Git.
Verified on pump after correction on 2026-05-24:
- OpenSSH Server installed and running automatically.
- SSH listens on TCP
22. - Key login to
post@localhostandpost@192.168.1.39works after adding the public key toC:\ProgramData\ssh\administrators_authorized_keys. - TigerVNC viewer
1.16.2installed atC:\Program Files\TigerVNC\vncviewer.exe. - TightVNC Server
2.8.87installed through winget packageGlavSoft.TightVNC. - TightVNC service
tvnserverruns automatically and listens on TCP5900and5800. - TigerVNC WinVNC server was the wrong initial server choice on
pump; its service is stopped and disabled. - Handshake on
192.168.1.39:5900returnsRFB 003.008and advertisesVNCAuth,Tight, not unauthenticatedNone.
OpenSSH Setup
Run from an elevated PowerShell:
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Set-Service sshd -StartupType Automatic
Start-Service sshd
Set-Service ssh-agent -StartupType Automatic
Start-Service ssh-agent
New-NetFirewallRule -Name OpenSSH-Server-In-TCP -DisplayName "OpenSSH Server (sshd)" -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
For local administrator accounts, Windows OpenSSH usually ignores C:\Users\<user>\.ssh\authorized_keys because the default sshd_config has:
Match Group administrators
AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
Copy only public keys into C:\ProgramData\ssh\administrators_authorized_keys, then restrict ACLs:
$adminKeys = "$env:ProgramData\ssh\administrators_authorized_keys"
New-Item -ItemType Directory -Force -Path (Split-Path $adminKeys) | Out-Null
Get-Content "$env:USERPROFILE\.ssh\authorized_keys" | Set-Content $adminKeys -Encoding ascii
icacls $adminKeys /inheritance:r
icacls $adminKeys /grant "SYSTEM:F" "Administrators:F"
icacls $adminKeys /remove "Users" "Authenticated Users" "Everyone"
Restart-Service sshd
Do not commit private keys. Public keys may be documented or stored in locations/ssh-public-keys/ when useful.
TightVNC Server Setup
Use this as the Windows garage VNC server baseline:
winget install --id GlavSoft.TightVNC --exact --accept-package-agreements --accept-source-agreements --silent
Set-Service tvnserver -StartupType Automatic
Start-Service tvnserver
New-NetFirewallRule -Name TightVNC-Server-In-TCP -DisplayName "TightVNC Server (5900)" -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 5900
New-NetFirewallRule -Name TightVNC-Http-In-TCP -DisplayName "TightVNC Web Access (5800)" -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 5800
Start-Process "C:\Program Files\TightVNC\tvnserver.exe" -ArgumentList "-configservice"
In the TightVNC Service Configuration window:
- keep
Accept incoming connectionsenabled; - keep
Require VNC authenticationenabled; - set a primary password outside Git;
- optionally set a control password outside Git;
- apply and restart the
tvnserverservice if needed.
Notes:
127.0.0.1:5900may reject withSorry, loopback connections are not enabled; test through the LAN/VPN address instead.- Short/simple passwords are easy for local calibration work but weak for exposed networks. Keep VNC restricted to trusted LAN/VPN/firewall scopes.
- Do not paste or commit TightVNC passwords.
TigerVNC Viewer
The Windows winget package TigerVNC.TigerVNC installs the viewer only. Install it when the machine needs to connect to other VNC hosts:
winget install --id TigerVNC.TigerVNC --exact --accept-package-agreements --accept-source-agreements --disable-interactivity
Do not install TigerVNC WinVNC server as the standard Windows VNC server for the garage project. It was installed on pump first, but the user corrected the standard to TightVNC Server after the other computers used TightVNC successfully.
Verification
Get-Service sshd,ssh-agent,TigerVNC,tvnserver -ErrorAction SilentlyContinue
Get-NetTCPConnection -State Listen -LocalPort 22,5900,5800 -ErrorAction SilentlyContinue
ssh -i <PRIVATE_KEY_PATH> -o IdentitiesOnly=yes -o BatchMode=yes post@<HOST_OR_IP> hostname
For VNC, verify at minimum that TCP 5900 listens and that the server does not advertise unauthenticated None security. A real remote-control verification still requires the VNC password, which must remain outside this repository.
Service Recovery
For unattended garage machines, configure restart recovery for OpenSSH and TightVNC from an elevated shell:
sc.exe failure sshd reset= 86400 actions= restart/60000/restart/60000/restart/60000
sc.exe failureflag sshd 1
sc.exe failure tvnserver reset= 86400 actions= restart/60000/restart/60000/restart/60000
sc.exe failureflag tvnserver 1
Verified on pump on 2026-05-24.