NAS-to-Windows Remote Control: A Practical SSH Setup Guide

    Learn how to use an always-on NAS to schedule and run tasks on a Windows PC over SSH. This guide covers Windows SSH setup, dedicated accounts, authentication, firewall configuration, command templates, browser automation, troubleshooting, and deployment checks for a local automation workflow.

    NAS-to-Windows Remote Control: A Practical SSH Setup Guide

    1. Purpose and Use Cases

    A NAS is designed for continuous operation, low power consumption, and reliability, making it a useful always-on coordinator for automated tasks. A Windows desktop or workstation provides the CPU, GPU, and memory resources needed for demanding computation, rendering, and browser automation.

    Connecting the two creates a workflow that combines round-the-clock scheduling with high-performance execution.

    Typical use cases include:

    • Scheduled tasks: Have the NAS coordinate waking and controlling a Windows host at a specified time to run scripts, batch jobs, or data-processing tasks. Waking the host requires a separately configured mechanism; SSH alone does not power on a sleeping or shut-down computer.
    • Private command execution: Keep control traffic within the local network rather than exposing sensitive operations to the public internet.
    • Event-driven automation: Let an automation agent on the NAS trigger follow-up actions on Windows.
    • Browser automation: Run browser-based login, data collection, and form-submission workflows on Windows, then collect the results on the NAS.

    2. Architecture and Technology Choice

    The connection follows this basic structure:

    1. Automation agent on the NAS
    2. │ Local network / VPN
    3. ▼
    4. SSH server on the Windows host
    5. │
    6. ├── Query system information
    7. ├── Transfer files
    8. └── Run browser automation scripts

    The preferred approach uses the SSH server component available in Windows, avoiding the need for additional third-party remote management software.

    This approach offers three practical benefits:

    1. Fewer additional components to install, maintain, and secure.
    2. Compatibility with automation agents that support remote command execution over SSH.
    3. Encrypted transport for commands, files, and authentication traffic.

    3. Windows Setup: Enable SSH and Create a Dedicated Account

    3.1 Install and Start the SSH Server

    Add the Windows SSH server component through Optional features. After installation, confirm that the service is running and configure it to start automatically.

    You can check this in the Services console or run the following commands in an elevated PowerShell session:

    1. Get-Service -Name *ssh*
    2. Set-Service -Name sshd -StartupType Automatic
    3. Start-Service -Name sshd

    3.2 Create a Dedicated Remote Account

    Avoid using the built-in Administrator account for routine automation. A dedicated account makes permissions easier to manage and helps distinguish automated activity from manual administration.

    The following commands create an account, add it to the local Administrators group, and prompt for a password:

    1. net user remote-agent /add
    2. net localgroup Administrators remote-agent /add
    3. net user remote-agent *

    The group name shown assumes an English-language Windows installation.

    Adding the account to Administrators grants broad privileges. Use that step only if the automation requires administrative access; otherwise, grant only the permissions needed for its tasks.

    A dedicated account provides:

    • Permission isolation: Access can be tailored to the automation workload.
    • Clearer auditing: Logs identify automation activity separately from other users.
    • Simpler account management: Automation does not depend on the built-in Administrator account or its account-specific restrictions.

    3.3 Investigate Administrator Authentication and Permission Issues

    A correct password does not guarantee a successful SSH login. Account restrictions, SSH configuration, and local security policies can all affect access.

    If an administrator account cannot connect or cannot perform the required operations:

    1. Open Local Security Policy → Local Policies → User Rights Assignment and review Access this computer from the network for the relevant account or group.
    2. Review applicable local-account remote-access and User Account Control policies.
    3. Distinguish an authentication failure from a permissions problem after login. Remote UAC token filtering is not a general fix for SSH password authentication.
    4. Restart the SSH service after changing its configuration, then test again.

    The registry value LocalAccountTokenFilterPolicy, when set to 1, relaxes remote UAC token filtering for local administrator accounts in applicable remote-access scenarios. This broadens administrative access and should not be treated as a routine SSH troubleshooting step. Confirm that the restriction actually applies before changing it.

    3.4 Configure the Firewall and Network

    Allow inbound SSH traffic on TCP port 22, and ensure that the NAS can reach the Windows host over the local network or a secure tunnel.

    The following command creates an inbound firewall rule:

    1. New-NetFirewallRule -DisplayName "Allow SSH" -Direction Inbound -LocalPort 22 -Protocol TCP -Action Allow

    Check the rule’s scope so that access is limited to the intended private network.

    Security guidance: Do not forward the SSH port directly to the public internet. For access from outside the network, connect through a VPN first. Prefer SSH key authentication over passwords, but do not treat key authentication as a substitute for restricting network exposure.

    4. NAS Setup: Configure Connections and Command Templates

    4.1 Create a Basic Remote Connection

    In the NAS automation agent, create a reusable SSH connection template with these settings:

    • Host: The Windows host’s private IP address. Use a fixed address or a router reservation where possible.
    • Port: 22.
    • Authentication: Prefer an SSH key pair generated on the NAS. Install the public key in the authorized-keys location used by the Windows SSH server for that account. If using a password, choose a strong one.
    • Username: The dedicated automation account.
    • Encoding: Use UTF-8 consistently where supported to reduce output-encoding problems.

    For a standard user, the public key is typically stored in the account’s authorized_keys file. Administrator accounts may use a different authorized-keys location under the Windows SSH server configuration, so verify the applicable configuration rather than assuming the user-level file will be used.

    4.2 Common Command Templates

    Query System Information

    Use system-information commands to verify connectivity and inspect the host’s resources:

    1. systeminfo
    2. wmic cpu get name,numberofcores
    3. wmic logicaldisk get caption,freespace,size

    The wmic commands depend on WMIC being available on the Windows host.

    Transfer Files

    Use an SSH-based encrypted file-transfer channel to:

    • Send scripts from the NAS to Windows.
    • Return generated results from Windows to the NAS.

    Choose a destination directory that the automation account can write to, such as a working folder under its user directory.

    Run Browser Automation

    Install the required browser automation runtime on Windows before triggering scripts remotely.

    For reliable execution:

    • Store scripts at a consistent path, such as C:\automation\run.ps1.
    • Start them through a scheduled task or a direct command-line invocation.
    • Avoid interactive prompts or dialog boxes that can block unattended execution.
    • Use browser settings suitable for unattended operation when no desktop session is available.

    An SSH session should not be assumed to provide an interactive Windows desktop. Test the browser workflow under the same session conditions that the NAS will use.

    5. Troubleshooting Common Problems

    5.1 Permission Denied

    If SSH reports Permission denied:

    • Verify the username and password or key.
    • Check whether the SSH server configuration allows the account or its group to log in.
    • Confirm that password or public-key authentication is enabled, as appropriate.
    • For administrator accounts, check the applicable authorized-keys configuration and account policies.
    • Follow the checks in Section 3.3 rather than assuming remote UAC token filtering caused the authentication failure.

    5.2 Connection Timed Out

    If the connection times out:

    • Confirm that the Windows host is powered on and reachable.
    • Check that the SSH service is running.
    • Verify that the firewall permits TCP port 22 from the NAS.
    • Use ping and, from a Windows system, Test-NetConnection <IP> -Port 22 to investigate connectivity.
    • Check routing and access rules if the NAS and Windows host are on different subnets or VLANs.

    A failed ping does not necessarily mean SSH is unavailable, because ICMP traffic may be blocked independently of TCP port 22.

    5.3 Account Cannot Log In

    If the account is rejected:

    • Make sure the newly created account has a password. Do not rely on a blank-password account for remote access.
    • Check whether the account is disabled or locked out.
    • Review local security policies that may restrict network access.
    • Confirm that the SSH server configuration does not exclude the account.

    5.4 Garbled Output

    Output can become unreadable when the Windows command-line code page differs from the encoding expected by the NAS.

    Possible remedies include:

    • Switch the command-line code page to UTF-8 with chcp 65001 before running the relevant command.
    • Configure the automation agent to interpret output as UTF-8.
    • Prefer simple English-language working paths when non-ASCII paths cause encoding ambiguity.

    Changing the code page does not guarantee that every application will emit UTF-8. Test the actual commands used by the workflow.

    6. Deployment Validation Checklist

    After configuration, verify each part of the workflow:

    1. Service availability: The Windows SSH service is running and starts automatically.
    2. Network reachability: The NAS can connect to TCP port 22 on the Windows host.
    3. Authentication: The dedicated account can log in, with no unexpected authentication errors in the logs.
    4. Command execution: Running systeminfo remotely returns the expected information.
    5. File transfer: Scripts can move from NAS to Windows, and results can return from Windows to NAS.
    6. Automation execution: A remotely triggered browser automation script completes and produces the expected output.
    7. Failure handling: Temporarily stop the SSH service and confirm that the NAS detects the failure and alerts or retries as configured.
    8. Security: SSH is not exposed directly to the public internet, and passwords or private keys are stored securely.

    7. Conclusion

    Using Windows SSH as the control channel lets a NAS coordinate tasks while a more powerful Windows host performs the work. A dedicated account separates automation activity from everyday use, and private-network access helps keep the control channel contained.

    The main setup work involves the Windows SSH service, account permissions, firewall rules, and the NAS connection template’s authentication and encoding settings. Once command execution, file transfer, and unattended automation have been validated, the same connection can support scheduled jobs, private command exchange, event-driven workflows, and browser automation without additional commercial remote management software.