How to Configure Windows Server SFTP Only User

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a windows server sftp only user by locking the SSH daemon to file transfers. You also lock that user account into one folder and block shell access. Many teams first grant normal SSH access when they need quick file sharing on Windows. That broad setup lets file transfer users open a command prompt and run system scripts. If an attacker steals that key, they can move across the whole server. How to set up a windows server sftp only user Windows Server runs the OpenSSH service to ha

User Provisioning (SCIM) + Kubernetes API Server Access: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up a windows server sftp only user by locking the SSH daemon to file transfers. You also lock that user account into one folder and block shell access. Many teams first grant normal SSH access when they need quick file sharing on Windows. That broad setup lets file transfer users open a command prompt and run system scripts. If an attacker steals that key, they can move across the whole server.

How to set up a windows server sftp only user

Windows Server runs the OpenSSH service to handle both remote shells and file transfers. By default, any user who can log in over SSH also gets a shell. To stop this, you must change how the OpenSSH daemon handles that specific user or group. You add a match rule in the daemon settings that targets the transfer account.

Inside that match rule, you force the daemon to run the internal SFTP server process. When the user connects, the server ignores any request to start PowerShell or a command prompt. It only speaks the file transfer protocol for the life of that connection. Next, you set a root directory rule for that same user account.

This rule locks the user inside one specific folder on the Windows disk. The user sees that folder as the top level of the file system. They cannot move up the folder tree to read system files or other apps. You must also set Windows file permissions so the user only reads or writes approved folders.

Teams should also turn off network port forwarding inside that same daemon match block. Otherwise, an SFTP account could still tunnel network traffic through the Windows host to internal servers.

Using OpenSSH certificates for file transfer accounts

Static SSH keys and passwords create big risks when you share them with vendors or scripts. Public keys stay on disk forever unless an admin remembers to remove them. OpenSSH 5.4 added user and host certificates to fix this static key problem. These certificates use a much simpler format than standard web TLS certificates.

You use the key tool and a Certificate Authority key to sign a user public key. The signed certificate holds the public key, a key identity, and allowed user names. It also holds a set of options that limit what the session can do. You can embed command limits and turn off port forwarding right inside the signed certificate.

User Provisioning (SCIM) + Kubernetes API Server Access: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

By default, a signed OpenSSH certificate stays valid forever if you do not set a limit. Admins should always set a short validity window when signing keys for file transfer users. Short lifetimes mean a stolen key stops working on its own after a few hours.

What native SFTP locks solve and what they miss

Locking an account to SFTP stops users from running interactive shell commands on your Windows host. It also keeps them inside one folder tree and blocks network port tunnels. This setup solves the basic problem of separating file transfers from full server admin roles.

Still, native OpenSSH rules only check who logs in and which subsystem starts. Once the session begins, the server does not inspect the files moving across the wire. A user with read rights can pull down an entire folder of sensitive records at once. Standard file permissions cannot rewrite phone numbers, emails, or card numbers inside downloaded files.

Managing local accounts and folder rules across dozens of Windows servers also takes heavy manual work. Admins have to edit daemon text files and sync user groups on every single machine. When an engineer needs one-time access to fix a bad file, teams often share static keys. That leaves a major gap in audit logs and day-to-day security control.

Check SSH commands and file transfers on the host

OpenSSH keys and certificates decide who can log into a Linux host. They do not check what a one-shot command or file transfer does once the session starts. With hoop.dev, you run an open-source SSH server with guardrails inline on the host. On every one-shot command or file transfer an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

When a caller runs a one-shot command or moves a file, hoop.dev guardrails check the command or path before it runs, and hoop.dev data masking masks matched sensitive patterns in downloads and output. Interactive shells carry no guardrails because keystrokes have no statement boundary. Teams can turn interactive shells off and allow only commands and file tasks. The audit trail logs who connected and what was allowed or refused, without storing keystrokes or file bytes. See the source on GitHub.

Frequently asked questions

Can a Windows Server SFTP only user still run PowerShell commands?

No, forcing the internal SFTP subsystem in the SSH daemon blocks all shell requests. When the user connects, the server rejects PowerShell and command prompt startups right away.

Do I need third-party software to lock SFTP users to one folder on Windows?

No, the built-in OpenSSH service on Windows Server supports root directory locks natively. You pair that daemon rule with standard Windows folder permissions to isolate the user.

How do OpenSSH certificates improve Windows SFTP security?

Certificates let you sign user keys with a central authority key and set an expiration time. You do not need to copy static public keys to every Windows host.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.