Remote Control a Windows PC from a NAS with SSH: A Full Automation Walkthrough

    This guide shows how to turn a NAS into an always-on controller that wakes and drives a Windows PC over SSH on the local network. It covers the overall architecture, installing and starting the built-in OpenSSH Server on Windows, working around the Administrator account's password-login restriction by creating a dedicated account, basic hardening practices, NAS-side connection setup and command templates, a troubleshooting guide for common failures such as permission denied, connection timeouts, account lockouts and garbled output, and a deployment verification checklist. No third-party remote-control software is required, and no public ports are exposed.

    Remote Control a Windows PC from a NAS with SSH: A Full Automation Walkthrough

    1. Why This Setup Matters

    Many hobbyists and technical teams run into the same problem: a NAS stays online 24/7, which makes it an ideal host for scheduled jobs and automation pipelines, but its compute power is usually limited. A desktop or workstation running Windows at home is far more powerful, yet it cannot stay powered on around the clock.

    Connect the two, and you get the best of both worlds. The NAS can wake the Windows machine on demand and drive it to run tasks, giving you an always-on controller plus high-performance compute in one self-contained local automation system.

    Typical use cases include:

    • Scheduled jobs: the assistant on the NAS triggers the Windows PC at set times to run batch file processing, data computation, and similar work.
    • Secure LAN-only interaction: all traffic stays on the local network with no public ports exposed, making it safer and more controllable than a public-facing remote access setup.
    • Automated chaining: events collected on the NAS trigger scripts, applications, or browser automation flows on the Windows side.
    • Web automation: driving a browser on Windows remotely to perform repetitive logins, scraping, and form submissions.

    2. Architecture at a Glance

    The chain is deliberately simple:

    1. NAS (assistant / always online)
    2. │ SSH (LAN)
    3. ▼
    4. Windows PC (OpenSSH Server / execution node)

    The assistant on the NAS handles thinking and decision-making, sending commands to Windows over SSH. On the Windows side, you only need to enable the built-in OpenSSH server and configure an account. The whole chain depends on no third-party remote-control software, all traffic is encrypted, setup cost is low, and maintenance is straightforward.

    3. Windows Setup: Standing Up the SSH Service

    3.1 Install the OpenSSH Server

    Windows 10 (1809 and later) and Windows 11 ship with the OpenSSH components built in, so there is no separate installer to download. Install the OpenSSH Server through Settings → Apps → Optional features → Add a feature, or use an elevated PowerShell session:

    1. # Check installation status
    2. Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*'
    3. # Install if missing
    4. Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
    5. # Start the service and set it to start automatically
    6. Set-Service -Name sshd -StartupType Automatic
    7. Start-Service sshd

    Once installed, confirm that port 22 is allowed through the firewall (the installer usually creates the inbound rule automatically), then verify connectivity from another device on the LAN:

    1. ssh username@WINDOWS_HOST_IP

    3.2 Fix the Administrator Password-Login Restriction

    This is a common stumbling block. For security reasons, the built-in Administrator account on Windows is blocked from SSH password authentication by default — even the correct password is rejected. Some systems also apply policy restrictions to interactive logon for members of the Administrators group.

    The recommended fix is to create a dedicated remote account rather than forcing changes to the Administrator policy:

    1. # Create a dedicated account
    2. net user remote_ops /add
    3. net localgroup Administrators remote_ops /add
    4. # Set a strong password
    5. net user remote_ops YourStrongPassword!

    Adding the account to the Administrators group gives it full command execution rights; pair that with a strong password. If you insist on using an existing account, you can adjust policy items such as “Allow log on through Remote Desktop Services” and “Deny log on locally” under Local Security Policy. The dedicated-account approach is still preferable: the permission boundary is clearer, and auditing and revocation are easier later.

    3.3 Basic Hardening

    • Expose the SSH port on the LAN only, and do not create a port-forwarding rule on the router.
    • Switch SSH authentication to key-based and disable password login if you want to go further.
    • Review the OpenSSH-related entries in Event Viewer periodically and watch for abnormal login attempts.

    4. NAS Setup: Establishing the Connection

    The assistant on the NAS side typically offers a “remote connection” or “command execution” template capability. Configuration points:

    1. Connection details: target host IP, port (22 by default), username and password (the dedicated account created above).
    2. Command templates: define common commands ahead of time and invoke them as needed. Examples:
      • System information: systeminfo, or hostname && whoami
      • Resource usage: tasklist, typeperf counter commands
      • File transfer: use scp to move files between the NAS and Windows — push input data from the NAS into a Windows working directory, then pull the results back when the job finishes.
      • Browser automation: deploy the automation script on Windows in advance (for example, a script built on a browser driver), have the NAS trigger it over SSH, then read the log to confirm the outcome.
    3. Orchestration: chain “transfer input files → trigger execution → validate results → return artifacts” into one flow, and you have an unattended, closed-loop pipeline.

    5. Troubleshooting Common Failures

    1. Permission denied

    • Confirm the username and password, and watch for special characters in the password that need escaping on the command line.
    • Check whether you are hitting the Administrator login restriction; verify with the dedicated account instead.
    • Confirm that security policy is not blocking remote logon for the account.

    2. Connection timed out

    • Work through the network layer by layer: check whether the target IP responds to ping.
    • Check whether the Windows firewall allows port 22.
    • Confirm the service is running: Get-Service sshd.
    • Check whether the NAS and Windows are on the same subnet, or whether VLAN separation, AP isolation, or similar network policies are in play.

    3. Account refused

    • Rule out a locked account (repeated failed attempts can trip the lockout policy).
    • Check the thresholds under Local Security Policy → Account Policies, and reset the account if necessary.

    4. Garbled output

    • The Windows command line defaults to GBK, while SSH clients typically parse output as UTF-8, which garbles non-ASCII text.
    • Fix it by forcing the PowerShell console to UTF-8:
    1. [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
    2. $OutputEncoding = [System.Text.Encoding]::UTF8

    Alternatively, standardize on English or structured, timestamped log output at the script level to sidestep encoding differences entirely.

    5. Command succeeds but produces no output

    • Some GUI applications cannot render a window inside an SSH session; this is expected behavior.
    • Write key steps to a log file and read that log over SSH to confirm the result.

    6. Verification Checklist

    After deployment, work through this list. If everything passes, the chain is complete and usable:

    • An SSH connection can be established from the NAS on the LAN.
    • The dedicated account logs in without permission-denied errors.
    • Basic commands (hostname, systeminfo) return normally with no garbled text.
    • Two-way file transfer works over scp.
    • The NAS-side assistant triggers a Windows script from a template and retrieves its output.
    • Scheduled jobs run at the expected time and their results are inspectable.
    • After a Windows reboot, the SSH service comes back automatically with no manual intervention.

    7. Summary

    Pairing the assistant on your NAS with the OpenSSH server built into Windows gives you a secure, stable, orchestratable remote automation chain with no third-party remote-control software and minimal cost. On the Windows side, the keys are installing the SSH service correctly and avoiding the built-in Administrator login restriction. On the NAS side, the keys are well-organized command templates and task orchestration. Once configured, you have an always-on command center and a high-performance execution node on call — a solid foundation for more complex local automation later.