Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk5 min

OpenSSH SFTP Server on Linux: Setup and User Restrictions

Ubuntu includes SFTP with OpenSSH Server. Install the package, configure the subsystem and account, and use a carefully permissioned chroot when users need filesystem confinement.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To set up an SFTP server on Ubuntu, install OpenSSH Server, confirm its SFTP subsystem is enabled, and configure accounts in /etc/ssh/sshd_config or an included snippet. To make an account SFTP-only, use an appropriate Match rule with ForceCommand internal-sftp; add ChrootDirectory only if the user must be confined to a filesystem subtree. Validate the configuration with sudo sshd -t before restarting the SSH service.

How do I set up an SFTP server on Linux?

The commands below are for Ubuntu. Other Linux distributions may use different packages, service names, firewall tools, or configuration defaults. OpenSSH includes the SFTP subsystem, so a separate SFTP-server product is not required.

As an Amazon Associate I earn from qualifying purchases.

  1. Install the server package. On Ubuntu, run sudo apt install openssh-server. This installs the SSH daemon and server components; openssh-client is for client applications. See the Ubuntu OpenSSH server guide.
  2. Choose where to configure sshd. Edit /etc/ssh/sshd_config or create a configuration snippet under /etc/ssh/sshd_config.d/. Ubuntu’s main file includes snippets near the beginning, and for most directives OpenSSH uses the first value set. Check the existing configuration before adding a directive; placing a second value later may not override the first.
  3. Check the SFTP subsystem. The Subsystem directive can run sftp-server or use internal-sftp. The latter runs inside sshd and can simplify a chrooted configuration. Avoid adding a duplicate subsystem directive without checking what is already set.
  4. Create a dedicated account and grant only needed access. Follow your local account and group policy; the Ubuntu documentation does not prescribe one universal user-creation command. Give the account access to only the directories and files required for its transfer workflow.
  5. Validate before restarting. Run sudo sshd -t. If it reports an error, fix the configuration before proceeding.
  6. Restart and test. On Ubuntu, restart with sudo systemctl restart ssh.service. From a client, connect with SFTP using the server address and intended account, then verify authentication and the files the account can access. If administering the server remotely, test from a separate session and keep the working administrative session open until the new connection succeeds.

A bad sshd change can prevent the service from starting or lock out an administrator whose only access is SSH. Keep another way to reach the machine, or retain the current working session while validating and testing. Ubuntu’s guidance on configuration, validation, and restart is in its OpenSSH server guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I restrict a user to SFTP only?

Use a Match rule for the intended account or group and force the SFTP subsystem with ForceCommand internal-sftp. A restricted account does not need shell access for file transfers. The exact matching condition should reflect your account policy, and the rule must be checked against the existing configuration because OpenSSH’s first-value behavior applies to most directives.

#1 Best Overall
Sale
GMKtec G3S Mini PC Intel N95 Processor (Up to 3.4GHz) 8GB RAM 256GB M.2 SSD
  • 12th Intel Alder Lake N95 Processor – The GMKtec G3 S Mini PC is powered by the 12th Gen Intel N95 processor with 4 cores, 4 threads, 6MB cache and a burst frequency up to 3.4GHz. Compared with N100/N5105/N5100/N5095, the N95 delivers up to 36% overall performance improvement. Perfect for routine tasks, office work, and home entertainment, this compact mini desktop is more convenient than traditional bulky PCs.
  • 8GB RAM & 256GB SSD Storage – Pre-installed with 8GB DDR4 memory and a fast 256GB M.2 2242 SSD, the G3 S mini desktop offers quicker startup, smoother multitasking, and faster file transfers. Enjoy seamless performance whether you’re working on multiple applications, browsing, or streaming content.
  • Rich Interfaces & Connectivity – The G3 S mini computer comes equipped with USB 3.2 (up to 10Gbps), dual HDMI 2.0 (4K@60Hz), and a 3.5mm audio jack. With support for WiFi 5, Bluetooth 5.0, and Gigabit Ethernet (RJ45 1000MbE), it connects easily with monitors, projectors, printers, office equipment, and other peripherals, making it versatile for both home and business use.
  • Dual 4K Display Support – Featuring upgraded Intel UHD Graphics (up to 1000MHz), the G3 S supports 4K video playback and AV1 decoding for a smooth viewing experience. With dual HDMI outputs, you can connect two 4K@60Hz displays simultaneously, enabling efficient multitasking for work and entertainment.
  • GMKTEC WARRANTY - GMKtec offers a 3-year limited warranty (1 year replacement + 2 years parts replacement) for each mini PC, starting from the date of the purchase effective on all sales starting Oct. 2026. All defects due to design and workmanship are covered. With a professional after sales team always ready to attend to your needs, you can simply relax and enjoy your mini PC

If the user only needs file-transfer access but does not need to be confined to a subtree, forcing SFTP may be sufficient. If the account must not see files outside a designated filesystem area, configure ChrootDirectory in the relevant match rule as well. These are distinct controls: SFTP-only blocks the normal shell session, while a chroot limits the filesystem view.

Meet the chroot ownership requirements

OpenSSH checks the chroot path strictly. Every directory component in the ChrootDirectory path must be owned by root and must not be writable by other users or groups. The surrounding hierarchy must also not be modifiable by processes outside the jail. If the account needs to upload files, make a suitable directory inside the chroot writable by that account rather than making the chroot root itself writable.

With internal-sftp, a transfer-only chroot does not need an interactive shell or its support files. Some operating systems may still require /dev/log inside the chroot when SFTP logging is used. Consult the Ubuntu Noble sshd_config manual for the documented chroot requirements and subsystem behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
NIMO AI NAS, Agentic Computer Mini PC and AI Server, Intel Core Ultra 5 320 (up to 4.6 GHz, beat AI 5 340) up to 132TB ZFS Hybrid Storage, for 24hr AI Agent
  • High-Performance NAS with Powerful Procesor: Intel Core 5 320 is ideal for small offices, & More. You can enjoy smooth performance and seamless collaboration, while making use of advanced features like Docker and virtual machines. It works semalessly across every device inluding Windows, macOS, Linux, iOS, Android or Google services and so on.
  • Better Way to Store Than External Drives: NAS offers centralized storage, automatic backups, remote access, and a wide range of RAID options for easy data recovery even if a drive fails. Massive Storage Capacity: Never worry about storage limits again. With up 144TB capacity, you can store 50 million 1MB photos or 98K 1.5GB movies,5 million 30MB songs! *Hard Drives not included.
  • Secure Private Cloud: Retain 100% data ownership with advanced encryption to protect your files. Flexible permission management makes it easy to protect your privacy when collaborating with others.
  • AI-Powered Photo Album: Automatically organizes your photos by recognizing faces, scenes, objects, and locations. It can also instantly remove duplicates, freeing up storage space and saving you time.
  • User-Friendly App: Simple setup and easy file-sharing on Windows, macOS, Android, iOS, web browsers, and smart TVs, giving you secure access from any device.

Should you use sftp-server or internal-sftp?

Option How it works When it may fit
sftp-server The SFTP subsystem invokes the server program. Use it when the existing configuration or operational setup is built around the separate server program.
internal-sftp The SFTP implementation runs in the sshd process. It can simplify a chrooted, transfer-only setup because a separate program and shell support files are not needed inside the jail.

Both implement the SFTP subsystem. The OpenSSH manual describes the in-process implementation and its chroot use; it does not establish one choice as best for every server.

Choose the account scope before configuring it

Configuration choice Shell access Filesystem scope Operational consideration
Basic SFTP account Depends on the account and sshd policy; SFTP is available through the configured subsystem. Normal filesystem permissions determine access. Grant access only to the transfer directories the workflow requires.
SFTP-only account Disabled for the matched account by forcing internal-sftp. Normal filesystem permissions still apply unless a chroot is added. Match the rule narrowly to the intended user or group.
SFTP-only account in a chroot Disabled for the matched account. Confined to the configured chroot subtree. Maintain root ownership and non-writable permissions across every chroot path component; account for logging needs if enabled.

The choice depends on whether the user needs a shell, whether a filesystem boundary is required, whether the chroot permissions can be maintained, and whether logging inside the chroot is needed.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Set up key-based authentication

Ubuntu recommends Ed25519 keys, noting their shorter key size and lower computational requirements. Generate a key pair on the connecting client with ssh-keygen -t ed25519. The public key is the file ending in .pub; place it in the target account’s ~/.ssh/authorized_keys. Keep the private key on the client, and consider protecting it with a passphrase. Follow the account’s ownership and permission policy so sshd will accept the authorized key.

Rank #3
AMD Ryzen™ AI Halo - Personal AI Desktop Computer - Developer Platform - Linux OS
  • Built for Local AI Development: AMD Ryzen AI Halo is designed for local AI development and inference, featuring 128GB unified memory and support for up to 200B parameter models to build and run intensive AI workloads locally.
  • 128GB Unified Memory: Features 128GB LPDDR5x unified memory at 8000 MT/s with 256 GB/s memory bandwidth, providing a shared memory pool across the CPU, GPU, and NPU to support larger AI models.
  • AMD Ryzen AI Max+ 395 Processor: Features 16 cores, 32 threads, and Zen 5 architecture, paired with AMD Radeon 8060S integrated graphics featuring 40 RDNA 3.5 compute units and an AMD XDNA 2 NPU with up to 50 TOPS.
  • Linux AI Developer Platform: Purpose-built for Linux-based AI development with full AMD ROCm software support and preloaded tools, models, and workflows optimized for local AI development.
  • Compact, Connected Design: Includes a 2TB M.2 SSD, 10GbE LAN, Wi-Fi 7, Bluetooth 5.4, USB-C connectivity, and HDMI 2.1b.

The Ubuntu Noble manual lists StrictModes yes as the default for checking ownership and modes on user files and home directories. Chroot path checks are separate. The same manual lists PermitRootLogin prohibit-password and port 22 as defaults; these values are specific to that manual version and do not guarantee the effective settings on another distribution or a locally changed host.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use port and access controls as part of a larger policy

Changing the SSH port is not a substitute for strong authentication, least-privilege accounts, software updates, or an appropriate network policy. The documented default port is not a security recommendation. Before exposing a server beyond a trusted network, decide which clients should be able to reach it and apply the host’s firewall and network controls using instructions appropriate to the distribution and environment.

Configuration checks before you finish

  • Confirm the intended subsystem is configured and there is no conflicting earlier directive.
  • For SFTP-only access, scope the Match rule to the intended users or group and force the SFTP subsystem.
  • If using a chroot, verify root ownership and non-writable permissions for every path component, then test that the user can write only where intended.
  • Run sudo sshd -t before restarting the service.
  • Test a fresh SFTP connection and its permitted file access before ending a remote administrative session.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.