sftp-server — OpenSSH SFTP server subsystem
| Use Case | Command | Description |
|---|---|---|
| 🔧 Start SFTP subsystem | /usr/libexec/sftp-server | Default invocation via sshd Subsystem |
| 🐛 Debug logging | sftp-server -e -l DEBUG | Log to stderr with debug level |
| 🏷️ Set log facility | sftp-server -f LOCAL0 | Use a specific syslog facility |
| 📂 Starting directory | sftp-server -d /chroot/%u | Alternate start directory with token expansion |
| 🔒 Read-only mode | sftp-server -R | Deny all write operations |
| 🚫 Deny specific requests | sftp-server -P write,rename | Block certain SFTP protocol requests |
| ✅ Allow only specific requests | sftp-server -p read,open,close | Permit only a subset of requests |
| ❓ Query supported requests | sftp-server -Q requests | List all request types for allow/deny lists |
| 🔢 Set umask | sftp-server -u 022 | Override default umask for new files |
sftp-server [-ehR] [-d start_directory] [-f log_facility] [-l log_level]
[-P denied_requests] [-p allowed_requests] [-u umask]
sftp-server -Q protocol_feature
sftp-server is a program that speaks the server side of SFTP protocol to stdout and expects client requests from stdin. sftp-server is not intended to be called directly, but from sshd(8) using the Subsystem option.
Command-line flags to sftp-server should be specified in the Subsystem declaration. See sshd_config(5) for more information.
%% is replaced by a literal %, %d is replaced by the home directory of the user being authenticated, and %u is replaced by the username of that user. The default is to use the user's home directory. This option is useful in conjunction with the sshd_config(5) ChrootDirectory option.On some systems, sftp-server must be able to access /dev/log for logging to work, and use of sftp-server in a chroot configuration therefore requires that syslogd(8) establish a logging socket inside the chroot directory.
T. Ylonen and S. Lehtinen, SSH File Transfer Protocol, draft-ietf-secsh-filexfer-02.txt, October 2001, work in progress material.
sftp-server first appeared in OpenBSD 2.8.
Markus Friedl <markus AT openbsd.org>
Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-08-05 18:39 @216.73.216.192
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format