# Session Reference: Connecting to 小天's Windows + WSL

**Date:** 2026-05-15
**User:** 小天 (WeCom)
**Goal:** Deliver cron task outputs to local PC, enable remote command execution on WSL

## Environment

- Server: Ubuntu VM (Tailscale IP 100.99.120.35, hostname vm-0-13-ubuntu-3)
- User PC: Windows (Tailscale IP 100.113.96.40, hostname "node")
- WSL: Ubuntu, username "ookii"

## Connection Path

```
Hermes Server (100.99.120.35)
    → Tailscale
    → Windows SSH (ookii@100.113.96.40:22)
    → wsl.exe
    → WSL (ookii@localhost)
```

## Key Steps Taken

1. Installed Tailscale on both sides (was already on server, user installed on Windows)
2. Identified correct Target: Windows IP 100.113.96.40 (not WSL IP 100.121.9.5)
3. Set up Windows SSH key auth via `administrators_authorized_keys` (admin user!)
4. Fixed permissions with `icacls`
5. Tested WSL commands via `ssh ... "wsl.exe whoami"`

## Non-Obvious Findings

| Finding | Detail |
|---------|--------|
| **Windows admin SSH path** | `%ProgramData%\ssh\administrators_authorized_keys`, not `%USERPROFILE%\.ssh\authorized_keys` |
| **WSL needs .exe suffix** | From Linux SSH to Windows, must use `wsl.exe`, not `wsl` |
| **PowerShell curl != Linux curl** | `curl -fsSL` fails in PowerShell (it's an alias for Invoke-WebRequest) |
| **Windows sudo disabled** | Windows doesn't have `sudo` by default; direct users to WSL for Linux commands |
| **Chinese output garbled** | Windows SSH returns Chinese chars in ANSI encoding; command execution still works |

## Commands that Worked

```bash
# Test connection
ssh -o StrictHostKeyChecking=no ookii@100.113.96.40 "wsl.exe whoami && wsl.exe hostname"

# Run Hermes remotely in WSL
ssh -o StrictHostKeyChecking=no ookii@100.113.96.40 \
  "wsl.exe /home/ookii/.local/bin/hermes chat -q 'say hello' --yolo -Q"

# Check files
ssh -o StrictHostKeyChecking=no ookii@100.113.96.40 \
  "wsl.exe bash -l -c \"ls -la ~/.hermes/\""
```
